SQL语句获得排名前80%最高分
答案:1 悬赏:20 手机版
解决时间 2021-03-27 22:30
- 提问者网友:饥饿走向夜
- 2021-03-27 04:01
SQL语句获得排名前80%最高分
最佳答案
- 五星知识达人网友:笑迎怀羞
- 2021-03-27 04:44
select name,yuwen,shuxv,grade,rank_yuwen,rank_shuxv,rank_grade
from (
select name,yuwen,shuxv, (yuwen+shuxv) as grade,
rank() over (partition by name order by yuwen desc) rank_yuwen,
rank() over (partition by name order by shuxv desc) rank_shuxv,
rank() over (partition by name order by yuwen+shuxv desc) rank_grade
from table_name
)
比较麻烦,给你点提示吧,在这个基础上筛选下去
from (
select name,yuwen,shuxv, (yuwen+shuxv) as grade,
rank() over (partition by name order by yuwen desc) rank_yuwen,
rank() over (partition by name order by shuxv desc) rank_shuxv,
rank() over (partition by name order by yuwen+shuxv desc) rank_grade
from table_name
)
比较麻烦,给你点提示吧,在这个基础上筛选下去
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯