Syntax

The syntax of the INTERSECT clause is as follows:

select_statement INTERSECT select_statement

Description

select_statement is a SELECT statement that does not contain an ORDER BY or FOR UPDATE clause.

The INTERSECT operator computes the set intersection of the rows returned by the involved SELECT statements. If a row is included in two result sets, the row is in the intersection of the two result sets.

The result of the INTERSECT clause does not contain duplicate rows.

Unless otherwise specified in parentheses, multiple INTERSECT operators in the same SELECT statement are evaluated from left to right. The INTERSECT clause binds tighter than the UNION clause. A UNION B INTERSECT C is read as A UNION (B INTERSECT C).