Set Operator
UNION ALL Returns All rows selected by either query, including all duplicates
INTERSECT Returns All distinct rows selected by both queries
MINUS Returns All distinct rows that are selected by the first SELECT statement and not selected in the second SELECT statement
----------------------------------------------------------------------------
select job from emp where deptno=10
union
select job from emp where deptno=30
------------------------------
UNION ALL
select job from emp where deptno=10
union ALL
select job from emp where deptno=30
------------------------------
INTERSECT
select job from emp where deptno=10
INTERSECT
select job from emp where deptno=30
------------------------------
MINUS
select job from emp where deptno=10
MINUS
select job from emp where deptno=30
------------------------------
No comments:
Post a Comment