Tuesday, February 2, 2010

SQL INTERSECT

SQL INTERSECT allows combining results of two or more select queries. If a record exists in one query and not in the other, it will be omitted from the INTERSECT results.
Syntax:
Select field1, field2, . field_n from tables INTERSECT select field1, field2, . field_n from tables;
Example:
Select salary from employee INTERSECT select salary from manager;

0 Comments: