17,377
社区成员
发帖
与我相关
我的任务
分享
求统计各部门薪水前三的员工编号,员工姓名,部门名称,经理名称,总收入和总收入排名(部门内总体收入高的排名靠前,总收入相同的员工编号小的靠前)
-- ID,staff_NO,Staff_Name,Dept_name,Manager_Name,
table a
--ID,Staff_NO,Total_Incomes
table b
select a.staff_NO,a.Staff_Name,a.Dept_name,a.Manager_Name,b.Total_Incomes
from a and b
where a.staff_NO =b.Staff_NO and rownum <=3
group by a.Dept_name order by b.Total_Incomes asc