The exists-predicate tests for the existence of data meeting criteria specified in a subquery.
Expansion of exists-predicate
►►─── EXISTS ( subquery ) ────────────────────────────────────────────────────►◄
Specifies a subquery that returns a set of zero or more rows. For expanded subquery syntax, see Expansion of Subquery.
Truth Value of an EXISTS Predicate
The result of an EXISTS predicate is:
With the Unary Operator NOT in a WHERE Parameter
The following SELECT statement identifies employees for whom no expertise information has been stored in the database.
select e1.emp_id
from employee e1
where not exists
(select * from expertise e2
where e1.emp_id = e2.emp_id);
Note: For more information about search conditions, see Expansion of Search-condition.
|
Copyright © 2014 CA.
All rights reserved.
|
|