Set Operators
operator | description |
---|---|
UNION | Return the union of result sets |
EXCEPT | Return the relative complement of result sets |
INTERSECT | Return the intersection of result sets |
A set operation combines result sets retrieved by select queries into a single result set. If the ALL keyword is not specified, the result is distinguished.
UNION
select_query UNION [ALL] select_query
- select_query
- select_set_entity
Return all records of both result sets.
EXCEPT
select_query EXCEPT [ALL] select_query
- select_query
- select_set_entity
Return records of the result set of the left-hand side query that do not appear in the result set of the right-hand side query.
INTERSECT
select_query INTERSECT [ALL] select_query
- select_query
- select_set_entity
Return only records that appear in both result sets.