我们经常用的是NOT IN + 子查询 select emp_no from employees where emp_no not in (select emp_no from dept_manager);
select emp_no from employees where emp_no not in (select emp_no from dept_manager);
但是还可以用LEFT JOIN 的思路 SELECT e.emp_no FROM employees AS e LEFT JOIN dept_manager AS d ON e.emp_no=d.emp_no WHERE dept_no IS NULL;
SELECT e.emp_no FROM employees AS e LEFT JOIN dept_manager AS d ON e.emp_no=d.emp_no WHERE dept_no IS NULL;