Types of set operations:
- UNION ALL
- UNION
- MINUS
- INTERSECT
UNION ALL
Combines the results of two SELECT statements into one result set.
EX:select * from sales2000 UNION ALL select * from sales2001 ;
UNION
Combines the results of two SELECT statements into one result set, and then eliminates any duplicate rows from that result set.
EX:select * from sales2000 UNION select * from sales2001;
MINUS
Takes the result set of one SELECT statement, and removes those rows that are also returned by a second SELECT statement.
EX:select * from sales2000 MINUS select * from sales2001;
INTERSECT
Returns only those rows that are returned by each of two SELECT statements
EX:select * from sales2000 INTERSECT select * FROM sales2001;
No comments:
Post a Comment