题解 | 统计各个部门平均薪资

select 
t1.department as department
,round(avg(t2.normal_salary - t2.dock_salary),3) as avg_salary
from staff_tb as t1
join salary_tb as t2
on t1.staff_id = t2.staff_id
where (t2.normal_salary - t2.dock_salary) >= 4000 
	  and (t2.normal_salary - t2.dock_salary) <= 30000
group by t1.department
order by avg_salary desc;

全部评论

相关推荐

不愿透露姓名的神秘牛友
01-13 19:02
* 测试开发 18k*15 硕士其他
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务