An EXISTS predicate tests for the existence
of a row satisfying the search condition of a subquery. The predicate
evaluates to TRUE if at least one row satisfies the search condition
of the subquery.
Scope |
|
SQL Data Manipulation Statements
SQL Syntax |
|
Parameters |
|
Description |
|
Unlike other places in which subqueries occur, the EXISTS
predicate allows the subquery to specify more than one column in
its select list.
Example |
|
Get supplier names for suppliers who provide at least one
part.
SELECT S.SNAME
FROM S
WHERE EXISTS ( SELECT * FROM SP
WHERE SP.SNO = S.SNO );
|