SQL EXISTS Keyword

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








googletag.cmd.push(function() googletag.display('div-gpt-ad-1422003450156-2'); );



SQL EXISTS Keyword


❮ SQL Keywords Reference



EXISTS


The EXISTS command tests for the existence of any record in a subquery,
and returns true if the subquery returns one or more records.


The following SQL lists the suppliers with a product price less than 20:



Example



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


Try it Yourself »


The following SQL lists the suppliers with a product price
equal to 22:



Example



SELECT SupplierName
FROM Suppliers
WHERE EXISTS (SELECT ProductName FROM
Products WHERE SupplierId = Suppliers.supplierId AND Price = 22);


Try it Yourself »



❮ SQL Keywords Reference