Monday, 9 January 2017

Using Set Operators


The set operators combines rows returned by two or more queries. The number of columns and the column types returned by the queries must match, although the column names may be different.
OperatorDescription
UNION ALLReturns all the rows retrieved by the queries, including duplicate rows.
UNIONReturns all non-duplicate rows retrieved by the queries.
INTERSECTReturns rows that are in both queries.
MINUSSubtracts one set of rows from another set of rows.