题解 | #获取所有员工当前的manager#
获取所有员工当前的manager
http://www.nowcoder.com/practice/e50d92b8673a440ebdf3a517b5b37d62
子查询 + 连表方式
-- 先查出不是经理的员工 select emp_no, dept_no from dept_emp where emp_no not in (select emp_no from dept_manager); select e.emp_no, d.emp_no as manager from dept_manager d , (select emp_no, dept_no from dept_emp where emp_no not in (select emp_no from dept_manager)) as e where d.dept_no = e.dept_no;