Q:

Finding the rows that are not common in two tables in oracle

I have two tables with following values.
tab1              tab2
----              ----
A                   A
B                   E
C                   F
D                   G

Output should be as follows:
O/P
---
B
C
D
E
F
G

A:

select field from tab1
union all
select field from tab2

minus

(select field from tab1
 intersect
 select field from tab2
);

OR :)
select field from tab1
minus
select field from tab2

union all

select field from tab2
minus
select field from tab1

But, BEST(for performance :) ) :
select distinct nvl(a.field, b.field) as field
from tab1 a
full join tab2 b on (a.field=b.field)
where a.field is null or b.field is null;

See here a test for the above query.

