1、UNION取得两个结果集的并集并去掉重复行 AUB
SELECT ename,job,sal FROM emp WHERE sal>2500 UNION
SELECT ename,job,sal FROM emp WHERE job='MANAGER' ORDER BY 1;等同于
SELECT ename,job,sal FROM emp WHERE sal>2500 OR job='MANAGER' ORDER BY 1;UNION ALL取得两个结果集的并集并不去掉重复行
SELECT ename,job,sal FROM emp WHERE sal>2500 UNION ALLSELECT ename,job,sal FROM emp WHERE job='MANAGER' ORDER BY 1;2、INTERSECT取得两个结果集的交集 A交B
SELECT ename,job,sal FROM emp WHERE sal>2500 INTERSECT
SELECT ename,job,sal FROM emp WHERE job='MANAGER' ORDER BY 1;等同于
SELECT ename,job,sal FROM emp WHERE sal>2500 AND job='MANAGER' ORDER BY 1;3、MINUS取得两个集合的差集,只显示在集合A中的数据,并且不属于集合B的数据SELECT ename,job,sal FROM emp WHERE sal>2500 MINUSSELECT ename,job,sal FROM emp WHERE job='MANAGER' ORDER BY 1;4、