Sử dụng NOT EXISTS
Ví dụ: Tìm số hóa đơn đã mua tất cả những sản phẩm do “Trung Quoc” sản xuất.
Select sohd
from HOADON
where not exists (select * from SANPHAM where nuocsx=‘Trung Quoc’
and not exists (select * from CTHD where HOADON.sohd=CTHD.sohd and CTHD.masp=SANPHAM.masp))
Giải thích giùm em cái, cái này hồi trước học mà cô dạy giải thích em ko hiểu.
Ví dụ: Tìm số hóa đơn đã mua tất cả những sản phẩm do “Trung Quoc” sản xuất.
Select sohd
from HOADON
where not exists (select * from SANPHAM where nuocsx=‘Trung Quoc’
and not exists (select * from CTHD where HOADON.sohd=CTHD.sohd and CTHD.masp=SANPHAM.masp))
Giải thích giùm em cái, cái này hồi trước học mà cô dạy giải thích em ko hiểu.
![Confused](https://forum.uit.edu.vn/core/images/smilies/confused.png)
Comment