4. Elements of OpenSQL Statements : Predicates : Exists Predicate
 
Share this page                  
Exists Predicate
An exists predicate takes the form:
EXISTS (subquery)
An exists predicate expression evaluates to true if the set represented by subquery is nonempty. For example:
select ename
from   employee
where  exists
  (select *
  from   dept
  where  dno = employee.dept
  and  floor = 3);
It is typical, but not required, for the subquery argument to exists to be of the form select *.