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

考试分数(五)

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

select
    t1.id,
    t1.job,
    t1.score,
    t1.t_rank
from (
    -- 每个岗位里进行排名打标
    select
        id,
        job,
        score,
        row_number() over(partition by job order by score desc) t_rank
    from grade
) t1
inner join (
    -- 每个岗位的总数的一半
    select 
        job,
        round(count(job) / 2, 1) cn_half
    from grade
    group by job
) t2
on t1.job = t2.job 
where 
case 
    when substr(t2.cn_half,length(t2.cn_half)) then t_rank = round(t2.cn_half + 0.5,0) 
    else t_rank in (round(t2.cn_half,0),round(t2.cn_half + 1,0))
end 
order by t1.id;

全部评论

相关推荐

2025-12-19 15:04
门头沟学院 Java
小肥罗:hr爱上你了,你负责吗哈哈
点赞 评论 收藏
分享
嵌入式的小白:面试少的,说明你的投递的岗位和简历匹配度不高,技术这个东西很杂的,你这种情况,建议 1.看看嵌入式招聘的岗位需求,会有不同大方向的,比如MCU,RTOS的,或者linux上驱动的,或者应用层的,这都是简单分类,但对技术要求差异很大的 2.结合你的经验,看能和哪类匹配上,就找对应类别的 3.简历和招聘岗位需求对着看下,看人家需要啥,你会啥,匹配度高才有会高概率有面试的
秋招的第一个offer,...
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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