आपको INTERSECT
. का उपयोग करना चाहिए और MINUS
(ओरेकल के लिए):
-- 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')
चूंकि UNION
जोड़ता है EXCEPT
. के दौरान सबक्वायरी ऊपर /MINUS
घटाना उन्हें