题解 | #获取每个部门中当前员工薪水最高的相关信息#
汇总各个部门当前员工的title类型的分配数目
http://www.nowcoder.com/practice/4bcb6a7d3e39423291d2f7bdbbff87f8
select t1.dept_no,departments.dept_name,t1.title,t1.cnt from
(select dept_emp.dept_no,titles.title,count(*) cnt from dept_emp,titles where dept_emp.emp_no=titles.emp_no
group by dept_emp.dept_no,titles.title) t1,departments
where t1.dept_no=departments.dept_no
order by t1.dept_no
(select dept_emp.dept_no,titles.title,count(*) cnt from dept_emp,titles where dept_emp.emp_no=titles.emp_no
group by dept_emp.dept_no,titles.title) t1,departments
where t1.dept_no=departments.dept_no
order by t1.dept_no