1The SQL INTERSECT clause/operator is used to combine two SELECT statements,
2but returns rows only from the first SELECT statement
3that are identical to a row in the second SELECT statement.
4This means INTERSECT returns only common rows returned by the two
5SELECT statements.
1SELECT ID, NAME, Amount, Date
2 FROM Customers
3 LEFT JOIN Orders
4 ON Customers.ID = Orders.Customer_id
5INTERSECT
6 SELECT ID, NAME, Amount, Date
7 FROM Customers
8 RIGHT JOIN Orders
9 ON Customers.ID = Orders.Customer_id;
10
1SELECT column1 [, column2 ]
2FROM table1 [, table2 ]
3[WHERE condition]
4
5INTERSECT
6
7SELECT column1 [, column2 ]
8FROM table1 [, table2 ]
9[WHERE condition]