题解 | #获取每个部门中当前员工薪水最高的相关信息#
统计出当前各个title类型对应的员工当前薪水对应的平均工资
http://www.nowcoder.com/practice/c8652e9e5a354b879e2a244200f1eaae
select * from (
select aa.title,(select avg(b.salary)
from titles a
inner join salaries b on a.emp_no=b.emp_no
where a.title=aa.title
group by a.title) as cc
from titles aa
group by aa.title
) ccc
order by ccc.cc asc
select aa.title,(select avg(b.salary)
from titles a
inner join salaries b on a.emp_no=b.emp_no
where a.title=aa.title
group by a.title) as cc
from titles aa
group by aa.title
) ccc
order by ccc.cc asc