SQL在查询中生成ID序列号方法

在查表时,方法如下:

依name排序后生成序列ID

select ROW_NUMBER() Over(order by name desc) as ID,* from test

在做into插入表时如下:

select identity(int,1,1) as ID,* into table1 from table
posted @ 2019-03-24 17:22  杰克-李  阅读(1039)  评论(0)    收藏  举报