题解 | #获取所有非manager的员工emp_no#
获取所有员工当前的manager
http://www.nowcoder.com/practice/e50d92b8673a440ebdf3a517b5b37d62
先查询,再过滤
select
a.emp_no,
b.emp_no as manager
from dept_emp a
left join dept_manager b
on a.dept_no = b.dept_no
where a.emp_no != b.emp_no --剔除编号相同的记录;
a.emp_no,
b.emp_no as manager
from dept_emp a
left join dept_manager b
on a.dept_no = b.dept_no
where a.emp_no != b.emp_no --剔除编号相同的记录;