row_number() over partition by 分组聚合
作者:互联网
分组聚合,就是先分组再排序,可以的话顺手标个排名;如果不想分组也可以排名;如果不想分组同时再去重排名也可以
ROW_NUMBER() OVER( [PARTITION BY column_1, column_2,…] [ORDER BY column_3,column_4,…] )
Oracle和SQL server的关键字是over partition by
mysql的无关键字row_number() over (partition by col1 order by col2),表示根据col1分组,在分组内部根据col2排序
转自:https://www.cnblogs.com/starzy/p/11146156.html
标签:column,over,partition,col2,number,分组,row 来源: https://blog.csdn.net/rockstar541/article/details/119900467