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

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

!:where和having的区别

全部评论

相关推荐

06-13 15:45
辽宁大学 golang
咱就是说&nbsp;你不主动&nbsp;我也不会主动下一步hhh,急死了
恶龙战士:不建议把这种帖子发到牛客上,建议去小红书发
点赞 评论 收藏
分享
缒梦&独舞:这家公司是这样的,去年给我实习offer了,不过也是面着玩儿的,他周六还要去做公益志愿活动
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务