-- 다중열 서브쿼리
-- 쌍비교
select * from emp where (sal, deptno) in (select sal, deptno from emp where deptno=30 and comm is not null);
select empno, ename, job, deptno from emp where(job, sal) in (select job, min(sal) from emp group by job) order by job;
-- 비쌍비교
select empno, sal, deptno from emp where sal in (select sal from emp where deptno=30 and comm is not null)
and
deptno in (select deptno from emp where deptno=30 and comm is not null);
'응용 SoftWare > Oracle' 카테고리의 다른 글
게시판 (0) | 2017.01.13 |
---|---|
FROM 절에 서브쿼리 (0) | 2017.01.12 |
다중행 서브쿼리 (0) | 2017.01.12 |
SUBQUERY (0) | 2017.01.11 |
[내장 함수] COALESCE (0) | 2017.01.11 |