Team Fly 

Page 75


COL
---
1
2
3
4
5
6
7

7 rows selected.

union all

The union all set function is similar to the union query with the exception that it returns all rows from both tables with duplicates. The following example is a rewrite of the preceding union example using union all:

SQL> select * from x
  2  union all
  3  select * from y;

COL
---
1
2
3
4
5
6
5
6
7

9 rows selected.

intersect

The intersect operator will return all the rows in one table that also reside in the other. Column values 5 and 6 exist in both the tables. The following example demonstrates the intersect set function:

SQL> select * from x
  2  intersect
  3  select * from y;

COL
---
5
6
Team Fly 
0094