SQL server 经验分享(四):查询中增加序号列

语句:

select rowid = identity(int,1,1),* into #temp from 表名

select * from #temp

举例:

原始数据:

数据库为mydata, 表名为:刊名



 

语句:

select rowid = identity(int,1,1),* into #temp from [mydata].[dbo].[刊名]

select * from #temp

结果:



 

猜你喜欢

转载自zxlyecf2.iteye.com/blog/2013729