U moet INTERSECT
. gebruiken en MINUS
(voor Oracle):
-- At least at Boston or at Dallas
(SELECT DNAME
FROM DEPARTMENT
WHERE CITY = 'DALLAS'
UNION
SELECT DNAME
FROM DEPARTMENT
WHERE CITY = 'BOSTON')
MINUS
-- At Boston and at Dallas
(SELECT DNAME
FROM DEPARTMENT
WHERE CITY = 'DALLAS'
INTERSECT
SELECT DNAME
FROM DEPARTMENT
WHERE CITY = 'BOSTON')
Sinds UNION
voegt toe subquery's omhoog terwijl EXCEPT
/MINUS
aftrekken ze