题解 | #各用户等级的不同得分表现占比#

各用户等级的不同得分表现占比

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

select level,score_grade,
round(count(*)/(sum(count(*)) over(partition by level)),3) as ratio
from
(select user_info.uid,level,score,
case when score >= 90 then '优' when score >= 75 then '良'
when score >= 60 then '中' else '差' end as score_grade
from user_info,exam_record
where user_info.uid = exam_record.uid
and score is not null) a
group by level,score_grade
order by level desc,ratio desc

全部评论

相关推荐

05-09 13:22
门头沟学院 Java
点赞 评论 收藏
分享
缒梦&独舞:这家公司是这样的,去年给我实习offer了,不过也是面着玩儿的,他周六还要去做公益志愿活动
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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