实例 SQL 逻辑运算符 EXISTS

 
SELECT SupplierName
FROM Suppliers
WHERE EXISTS (SELECT ProductName FROM Products WHERE Products.SupplierID = Suppliers.supplierID AND Price < 20);
                    

输出结果

SupplierName
Exotic Liquids
New Orleans Cajun Delights
Tokyo Traders
Mayumi's
Pavlova, Ltd.
Specialty Biscuits, Ltd.
PB Kn?ckebr?d AB
Refrescos Americanas LTDA
Heli Sü?waren GmbH & Co. KG
Plutzer Lebensmittelgro?m?rkte AG
Formaggi Fortini s.r.l.
Norske Meierier
Bigfoot Breweries
Svensk Sj?f?da AB
Aux joyeux ecclésiastiques
New England Seafood Cannery
Leka Trading
Lyngbysild
Zaanse Snoepfabriek
Karkki Oy
G'day, Mate
Ma Maison
Pasta Buttini s.r.l.
Escargots Nouveaux