MINUS Operator
--====================================================
--MINUS
--====================================================
SELECT * FROM XX_EMP_TL A
A
|
||||||
EMPNO
|
ENAME
|
JOB
|
MGR
|
SAL
|
COMM
|
DEPTNO
|
7369
|
SMITH
|
CLERK
|
7902
|
800
|
20
|
|
7499
|
ALLEN
|
SALESMAN
|
7698
|
1600
|
300
|
30
|
7521
|
WARD
|
SALESMAN
|
7698
|
1250
|
500
|
30
|
7566
|
JONES
|
MANAGER
|
7839
|
2975
|
20
|
|
7654
|
MARTIN
|
SALESMAN
|
7698
|
1250
|
1400
|
30
|
7698
|
BLAKE
|
MANAGER
|
7839
|
2850
|
30
|
|
7782
|
CLARK
|
MANAGER
|
7839
|
2450
|
10
|
|
7788
|
SCOTT
|
ANALYST
|
7566
|
3000
|
20
|
|
7839
|
KING
|
PRESIDENT
|
5000
|
10
|
||
7844
|
TURNER
|
SALESMAN
|
7698
|
1500
|
0
|
30
|
7876
|
ADAMS
|
CLERK
|
7788
|
1100
|
20
|
|
7900
|
JAMES
|
CLERK
|
7698
|
950
|
30
|
|
7902
|
FORD
|
ANALYST
|
7566
|
3000
|
20
|
SELECT * FROM XX_EMP_TL B WHERE
DEPTNO IN (10)
B
|
||||||
EMPNO
|
ENAME
|
JOB
|
MGR
|
SAL
|
COMM
|
DEPTNO
|
7839
|
KING
|
PRESIDENT
|
5000
|
10
|
||
7782
|
CLARK
|
MANAGER
|
7839
|
2450
|
10
|
SELECT * FROM XX_EMP_TL A
MINUS
SELECT * FROM XX_EMP_TL B WHERE
DEPTNO IN (10)
RESULT
|
||||||
EMPNO
|
ENAME
|
JOB
|
MGR
|
SAL
|
COMM
|
DEPTNO
|
7369
|
SMITH
|
CLERK
|
7902
|
800
|
20
|
|
7499
|
ALLEN
|
SALESMAN
|
7698
|
1600
|
300
|
30
|
7521
|
WARD
|
SALESMAN
|
7698
|
1250
|
500
|
30
|
7566
|
JONES
|
MANAGER
|
7839
|
2975
|
20
|
|
7654
|
MARTIN
|
SALESMAN
|
7698
|
1250
|
1400
|
30
|
7698
|
BLAKE
|
MANAGER
|
7839
|
2850
|
30
|
|
7788
|
SCOTT
|
ANALYST
|
7566
|
3000
|
20
|
|
7844
|
TURNER
|
SALESMAN
|
7698
|
1500
|
0
|
30
|
7876
|
ADAMS
|
CLERK
|
7788
|
1100
|
20
|
|
7900
|
JAMES
|
CLERK
|
7698
|
950
|
30
|
|
7902
|
FORD
|
ANALYST
|
7566
|
3000
|
20
|
Comments
Post a Comment