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

考试分数(四)

https://www.nowcoder.com/practice/502fb6e2b1ad4e56aa2e0dd90c6edf3c

select job, a, d
from
    (
        select
            job,
            cast(row_number() over (
                partition by
                    job
                order by
                    score
            ) as signed )a,
            cast(row_number() over (
                partition by
                    job
                order by
                    score desc
            )as signed) d
        from
            grade
    ) as rk
where a=d or abs(d-a)=1 and a<d

正序反序相同或者差值为1,就是中位数

全部评论

相关推荐

点赞 评论 收藏
分享
06-20 17:42
东华大学 Java
凉风落木楚山秋:要是在2015,你这简历还可以月入十万,可惜现在是2025,已经跟不上版本了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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