题解 | #考试分数(五)#
考试分数(五)
https://www.nowcoder.com/practice/b626ff9e2ad04789954c2132c74c0512
select id, job, score, t_rank from (select *, rank()over(partition by job order by score desc) as t_rank, count(*)over(partition by job) as num from grade) a where a.t_rank in (floor((a.num+1)/2),floor((a.num+2)/2)) order by id