SQL 11) 获取所有员工当前的manager
获取所有员工当前的manager
http://www.nowcoder.com/questionTerminal/e50d92b8673a440ebdf3a517b5b37d62
方法)两表联结 且 员工不为manager
SELECT de.emp_no, dm.emp_no FROM dept_emp AS de LEFT JOIN dept_manager AS dm ON de.dept_no = dm.dept_no WHERE dm.to_date = '9999-01-01' AND de.emp_no NOT IN ( -- 员工不为manager SELECT emp_no FROM dept_manager);