SQL INTERSECT - Introduction and syntax
SQL - Dec 03, 2008 at 18:00 PM by Rajmeet Ghai
Explain the SQL INTERSECT statement. Write SQL syntax for the SQL INTERSECT
statement along with an example.
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;
|