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时,无法使用。

posted @ 2012-04-21 15:27  brian_lee  阅读(534)  评论(0编辑  收藏  举报