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:ExampleGet your own SQL Server SELECT SupplierNameFROM SuppliersWHERE EXISTS (SELECT ...
The SQL EXISTS Operator TheEXISTSoperator is used to test for the existence of any record in a subquery. TheEXISTSoperator returns TRUE if the subquery returns one or more records. EXISTS Syntax SELECTcolumn_name(s) FROMtable_name WHEREEXISTS...
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 SupplierNameFROM SuppliersWHERE EXISTS (SELECT ProductName FROM Products WHERE Supplier...
ExampleGet your own SQL Server SELECTSupplierName FROMSuppliers WHEREEXISTS(SELECTProductNameFROMProductsWHEREProducts.SupplierID = Suppliers.supplierIDANDPrice <20); Try it Yourself » The following SQL statement returns TRUE and lists the suppliers with a product price equal to 22: ...