sql 查询中增加行号

1、

Select identity(int,1,1) id,* into #tem from table1
select * from #tem
drop table #tem

select rowid=identity(int,1,1),userip into tempT from useraccess
select * from tempT

drop table tempT

不是好方法,尤其是含有union all时,无法使用。

原文地址:https://www.cnblogs.com/BrianLee/p/2461516.html