每日一题:如何计算除去最高、最低工资的部门平均工资
Python学习与数据挖掘
共 785字,需浏览 2分钟
·
2021-12-20 02:20
关注"Python学习与数据挖掘",
设为“置顶或星标”,第一时间送达干货
select a.deptno,avg(a.salary)
from
(
select *, rank() over( partition by deptno order by salary ) as rank_1
, rank() over( partition by deptno order by salary desc) as rank_2
from emp
) a
group by a.deptno
where a.rank_1 >1 and a.rank_2 >1
(长按三秒,即可进入)
后台已放置一份精心整理的技术干货,查看即可获取! 后台回复关键字:面试,带你进入高手如云的学习交流群! 推荐阅读
评论