select
*
from
employees
where
not exists(select emp_no from dept_emp where emp_no=employees.emp_no);//等同于
select
*
from
employees
where
emp_no not in(select emp_no from dept_emp);
前言题目来源于牛客网sql57:使用含有关键字exists查找未分配具体部门的员工的所有信息。代码如下:select *from employeeswhere not exists(select emp_no from dept_emp where emp_no=employees.emp_no);//等同于select *from employeeswhere emp_no not in (select emp_no from d.