题解 | #获取所有非manager的员工emp_no#
获取所有非manager的员工emp_no
http://www.nowcoder.com/practice/32c53d06443346f4a2f2ca733c19660c
SELECT e.emp_no FROM employees e WHERE e.emp_no not in (SELECT e.emp_no FROM employees e INNER JOIN dept_manager d on e.emp_no = d.emp_no)
筛选在部门的员工:SELECT e.emp_no FROM employees e INNER JOIN dept_manager d on e.emp_no = d.emp_no
排除在部门的员工,就是不在部门的员工:SELECT e.emp_no FROM employees e WHERE e.emp_no not in (SELECT e.emp_no FROM employees e INNER JOIN dept_manager d on e.emp_no = d.emp_no)