SQL 10) - NOT IN 获取所有非manager的员工emp_no
获取所有非manager的员工emp_no
http://www.nowcoder.com/questionTerminal/32c53d06443346f4a2f2ca733c19660c
方法1)两表联结 WHERE 筛选非manager员工
SELECT e.emp_no FROM dept_manager AS dm RIGHT JOIN employees AS e ON dm.emp_no = e.emp_no WHERE dm.emp_no IS NULL; -- 非manager
SELECT e.emp_no FROM dept_manager AS dm RIGHT JOIN employees AS e ON dm.emp_no = e.emp_no WHERE e.emp_no NOT IN ( -- 非manager SELECT emp_no FROM dept_manager);