非常感谢你分享的思路,之前在链接条件(B.t_rank between A.start and A.end)卡了很久。在你的基础上做了一点优化: select g.* from (select *, dense_rank()over(partition by job order by score desc) as t_rank from grade) g join (select job, ceil(count(*)/2) a,ceil((count(*)+1)/2)b from grade group by job) g1 on g.job = g1.job and t_rank between a and b order by g.id
点赞

相关推荐

点赞 评论 收藏
分享
05-12 17:28
已编辑
门头沟学院 硬件开发
ldf李鑫:不说公司名祝你以后天天遇到这样的公司
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务