题解 | #查找所有员工的last_name和first_name以及对应的dept_name#
查找所有员工的last_name和first_name以及对应的dept_name
http://www.nowcoder.com/practice/5a7975fabe1146329cee4f670c27ad55
SELECT last_name,first_name,dept_name from
(select emp_no,first_name,last_name from employees) as t1
left join
(select emp_no,d.dept_name from
departments as d
natural join dept_emp) as t2
(select emp_no,first_name,last_name from employees) as t1
left join
(select emp_no,d.dept_name from
departments as d
natural join dept_emp) as t2
on t1.emp_no = t2.emp_no;