将score按ID分组排名:rank() over(partition by id order by score desc) 将score不分组排名:rank() over(order by score desc) select id,area,score, rank() over(partition by id order by score desc) 分组id排序, rank() over(order by score desc) 不分组排序 from students order by i…
将score按ID分组排名:cume_dist() over(partition by id order by score desc)*sum(1) over(partition by id) 将score不分组排名:cume_dist() over(order by score desc)*sum(1) over() select id,area,score, sum(1) over() as 总数, sum(1) over(partition by id) as 分组个数, (cume_di…
将score按ID分组排名:dense_rank() over(partition by id order by score desc) 将score不分组排名:dense_rank() over(order by score desc) select id,area,score, dense_rank() over(partition by id order by score desc) 分组id排序, dense_rank() over(order by score desc) 不分组排序…