select *
from job_history
order by employee_id;
--union (합집합)
select employee_id, job_id
from employees
union
select employee_id, job_id
from job_history;
--intersect (교집합)
select employee_id, job_id
from employees
intersect
select employee_id, job_id
from job_history;
--minus (차집합)
select employee_id, job_id
from employees
minus
select employee_id, job_id
from job_history;
--select문 일치
select department_id, to_number(null) location_id, hire_date
from employees
union
select department_id, location_id, to_date(null)
from departments;
'ORACLE > SQL' 카테고리의 다른 글
계층검색(트리검색) (0) | 2013.02.20 |
---|---|
향상된 group by(그룹함수) (0) | 2013.02.20 |
제약조건(constraint) 생성, 수정, 삭제 실습 (cascade) (0) | 2013.02.20 |
테이블 생성, 수정 실습 (0) | 2013.02.20 |
view (뷰) 생성, 수정, 인라인뷰(inline view), Top-N 실습 (0) | 2013.02.20 |