Skip Headers
An EXISTS condition tests for existence of rows in a subquery.
EXISTS
Table 6-10 shows the EXISTS condition.
Table 6-10 EXISTS Condition
TRUE
SELECT department_id FROM departments d WHERE EXISTS (SELECT * FROM employees e WHERE d.department_id = e.department_id);