Subquery에 대한 본 수업을 듣기 전에, 가볍게 훑어보기 좋은 자료가 있어 백업하기로 한다.
https://www.slideshare.net/salmanmemon77964/subqueries-oracle-database
After completing this lesson, you should be able to do the following:
select Alias-of-Subquery
from tableName
where expression-Operator ( select Alias-of-Subquery
from tableName);
select last_name
from employee
where salary > ( select salary
from employee
where last_name = 'Abel');
select last_name, job_id, salary
from employees
where job_id = (select job_id
from employees
where employee_id = 141)
and salary > (select job_id
from employees
where employee_id = 143);
select last_name, job_id, salary
from employees
where salary = (select min(salary)
from employees);
select department_id, MIN(salary)
from employee
group by department_id
having min(salary) > (select min(salary)
from employee
where department_id = 50);
--Using the Any Operator in Multiple-Row Subqueries
select employee_id, last_name, job_id, salary
from employees
there salary < any (select salary
from employees
where job_id = 'IT_PROG')
and job_id <> 'IT_PROG';
--Using the All Operator in Multiple-Row Subqueries
select employee_id, last_name, job_id, salary
from employees
where salary < all (select salary
from employees
where job_id = 'IT_PROG')
and job_id <> 'IT_PROG';
In this lesson, you should have learned how to: