November 2003
Intermediate to advanced
816 pages
14h 53m
English
UNION Operator combines the results of two or more queries into a single result set consisting of all the rows belonging to all queries in the union. This is different from using joins that combine columns from two tables.
Two basic rules for combining the result sets of two queries with UNION are as follows.
The number and the order of the columns must be identical in all queries.
The data types must be compatible. See Table 4-8.
{< query specification > | ( < query expression > ) }
UNION [ ALL ]
< query specification | ( < query expression > )
[ UNION [ ALL ] < query specification | ( < query expression > )
[ ...n ] ]
| < query_specification ... |
Read now
Unlock full access