mysql-给表中每一行编号之row_number()函数

select 要查询的值,row_number() over(order by 表中某一个值) as 起一个列名 
from 要查询的表名
例:

select distinct user_guid,row_number() over(order by user_guid) as rows
from ods.t_hitch_driver_info

posted @ 2019-08-08 16:17  岁岁无终  阅读(26094)  评论(6编辑  收藏  举报