The exists predicate is used to test if a subquery returns any rows.
<exists predicate> ::= |
The result of the <exists predicate> is true if the result of the <query specification> is not empty (contains one or more rows), otherwise the result of the <exists predicate> is false.
SELECT * FROM a WHERE EXISTS |
The EXISTS Predicate. This query contains an uncorrelated subquery. It returns all rows from table aif there is at least one row in table bfor which the column cof table b has the value 0.