Opposite of INTERSECT in Oracle
oracle, sql
Solution
If both `select1` and `select2` return no duplicates, you can use something like this:
SELECT * FROM (select1 UNION ALL select2) a
GROUP BY a.col1, a.col2, ...
HAVING count(*) = 1
Problem
I have two selects and I want to combine them in such a way, that only rows unique in both selects are returned. Is there any built-in way in Oracle 10g to achieve this? I know I can do something like this: ``` (select1 UNION select2) MINUS (select1 INTERSECT select2) ``` but I would like to avoid it. Both `select1` and `select2` have 20 lines, so this way would be really obscure and difficult to maintain.