您应该使用
INTERSECT和
MINUS(对于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')
由于
UNIOn添加 子查询,而
EXCEPT/
MINUS减去 它们
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)