Loading...
Select Version
An existence query checks whether a derived table is empty.
EXISTS subquery
subquery
Subquery that returns a derived table.
Result
True if the derived table is not empty.
False if the derived table is empty.
Example
Select the customers that have not placed an order from the CUSTOMERS table:
SELECT company FROM customers
WHERE NOT EXISTS (SELECT order_num FROM orders
WHERE orders.cust_num = customers.cust_num)
company
Siemens AG
Plenzer Trading
Freddys Fishery
Externa & Co Kg