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

考试分数(四)

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

  1. 直接case when暴力做吧
with grade_rank as(
select job,
count(*) total
from grade group by job),

med_1 as(
select 
    job,
    case when total%2=1 then (total+1)/2
    when total%2<>1 then (total)/2 end,
    case when total%2=1 then (total+1)/2
    when total%2<>1 then (total)/2+1 end from grade_rank
)
SELECT * FROM MED_1
全部评论

相关推荐

07-01 13:37
门头沟学院 Java
steelhead:不是你的问题,这是社会的问题。
点赞 评论 收藏
分享
深夜书店vv:腾讯是这样的,去年很多走廊都加桌子当工区
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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