首页 > IT职业 > IT生活 > 显示每个班分数前的15%名的同学名单
select class,student,score from
(
select class,student,score,
rank()over(partition by class order by score desc)/count(*)over(partition by class) ratio
from a
)
where ratio<=0.15
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29867/viewspace-809517/ ,如需转载,请注明出处,否则将追究法律责任。