示例
select ENAME, JOB, SAL, DEPTNO
from EMP
where DEPTNO in (select DEPTNO from DEPT
where LOC = 'NEW YORK');
转换EXISTS
select ENAME, JOB, SAL, DEPTNO
from EMP
where exists(select 1 from DEPT
where DEPT.DEPTNO = EMP.DEPTNO
and DEPT.LOC = 'NEW YORK');
IN:匹配于子查询结果的任意一个值即可
EXISTS 操作符用于检查子查询返回行的存在性。