题解 | #考试分数(五)#

考试分数(五)

https://www.nowcoder.com/practice/b626ff9e2ad04789954c2132c74c0513

with a as(
select id,job,score,
row_number() over(partition by job order by score desc) as t_rank,
count(id) over(partition by job) as num
from grade
)
select id,job,score,t_rank
from a
where abs(t_rank-(num+1)/2) < 1
order by id,t_rank 

中位数的位置距离(总数+1)/2的位置小于1

全部评论

相关推荐

牛客383479252号:9,2学生暑期实习失利开始投小厂,给这群人整自信了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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