SELECT one_statement
UNION [ALL]
SELECT another_statement
MINUS [ALL]
SELECT one_more_statement
INTERSECT [ALL]
SELECT last_statement;
Rules for SET Operations.
1. Both the SELECT statements must have the same number of columns with the same attributes.
2. Casting and formatting has to be done in the 1st SELECT statement.
3. Note that there is only one semi colon used at the end of the last SELECT statement.
4. While using multiple SET Operators, follow the order of precedence.
a. INTERSECT operation is performed first
b. Then it is the turn of the UNION operator(s)
c. Then EXCEPT and at the last MINUS operation is performed.
5. By default the duplicate rows are eliminated from the answer sets but if at all you want you can get the same by the use of another operator ‘ALL‘.
Popularity: 9% [?]
Our Random Articles
- New Year Wishes 2010
- New Year Wishes
- How to use EXTRACT function with date and time columns
- How to Post on a Separate/New Page in WordPress
- Usage of Macro in Teradata
More Links




No Comment
Popular Articles