Skip Headers
Oracle® Database SQL Language Reference
11g Release 2 (11.2)

Part Number E10592-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

EXISTS Condition

An EXISTS condition tests for existence of rows in a subquery.

Description of exists_condition.gif follows
Description of the illustration exists_condition.gif

Table 7-11 shows the EXISTS condition.

Table 7-11 EXISTS Condition

Type of Condition Operation Example
EXISTS 

TRUE if a subquery returns at least one row.

SELECT department_id
  FROM departments d
  WHERE EXISTS
  (SELECT * FROM employees e
    WHERE d.department_id 
    = e.department_id)
   ORDER BY department_id;