用法:
内部嵌套一个查询
案例:查询和zlotkey相同的员工姓名和工资
1.查询zlotkey的部门
select department_id
from employees
where last_name = 'zlotkey'
2.查询部门号=1的姓名和工资
select last_name,salary
from employees
where department_id =(
select department_id
from employees
where last_name = 'zlotkey'
)
标签:last,name,employees,查询,department,zlotkey From: https://www.cnblogs.com/liujy2233/p/16985855.html