curiouswebster
asked on
Does INTERSECT return opposite from FULL OUTER JOIN?
Are the rows returned from two tables when using INTERSECT on those two tables the exact opposite set of rows returned with a FULL OUTER JOIN on those same two tables?
Thanks.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
not sure what you mean by "opposites" :)
LEFT JOIN
A -
B -
C C
RIGHT JOIN
C C
- D
UNION
A
B
C
D
UNION ALL
A
B
C
C
D
Table1 MINUS Table2
A
B
Table2 MINUS Table1
D
Table1
Col1
A
B
C
Table2
col1
C
D
INTERSECT
col1
C
-- is this the opposite?
select coalesece(t1.col1, t2.col2) col1
from table1 t1
FULL OUTER JOIN table2 t2
where t1.col1 is null
or t2.col1 is null
Col1
A
B
D
Col1
A
B
C
Table2
col1
C
D
INTERSECT
col1
C
-- is this the opposite?
select coalesece(t1.col1, t2.col2) col1
from table1 t1
FULL OUTER JOIN table2 t2
where t1.col1 is null
or t2.col1 is null
Col1
A
B
D
ASKER