表EMP如下:
EMPNO ENAME JOB MGR HIREDATE COMM DEPTNO
----- ---------- --------- ----- ----------- --------- ------
7369 SMITH CLERK 7902 1980/12/17 20
7499 ALLEN SALESMAN 7698 1981/2/20 300.00 30
7521 WARD SALESMAN 7698 1981/2/22 500.00 30
7566 JONES MANAGER 7839 1981/4/2 20
7654 MARTIN SALESMAN 7698 1981/9/28 1400.00 30
7698 BLAKE MANAGER 7839 1981/5/1 30
7782 CLARK MANAGER 7839 1981/6/9 10
7788 SCOTT ANALYST 7566 1987/4/19 20
7839 KING PRESIDENT 1981/11/17 10
7844 TURNER SALESMAN 7698 1981/9/8 0.00 30
7876 ADAMS CLERK 7788 1987/5/23 20
7900 JAMES CLERK 7698 1981/12/3 30
7902 FORD ANALYST 7566 1981/12/3 20
7934 MILLER CLERK 7782 1982/1/23 10
SQL> select * from emp where exists (select deptno from emp where deptno < 20);
执行完后,会输出整张表,为什么?
不是输出deptno小于20的记录么????
------解决方案--------------------