cume_dist(),名次分析——-最大排名/总个数

函数:cume_dist() over(order by id)

select id,area,score,

cume_dist() over(order by id) a, --按ID最大排名/总个数

cume_dist() over(partition by id order by score desc) b, --ID分组中,scroe最大排名值/本组总个数

row_number() over (order by id) 记录号

from students order by id,area;

原文地址:https://www.cnblogs.com/fanweisheng/p/11118963.html