Tuesday, February 2, 2010

SQL EXISTS

SQL EXISTS: If the subquery returns at least one row the EXISTS condition is considered "to be met".
Syntax:
SELECT columns FROM tables WHERE EXISTS ( subquery );
Example:
SELECT * FROM employee WHERE EXISTS (select * from appraisal where employee.employee_id = appraisal.employee_id);

0 Comments: