题解 | #考试分数(五)#
考试分数(五)
https://www.nowcoder.com/practice/b626ff9e2ad04789954c2132c74c0512
select t.id,t.job,t.score,t.t_rank
from
(select *,
DENSE_RANK() over (partition by job order by score DESC) as t_rank,
COUNT(job) over (partition by job) as num
from grade) t
where t.t_rank = FLOOR((t.num + 1)/2) or t.t_rank = CEIL((t.num + 1)/2)
order by t.id
查看7道真题和解析