sql 查询时加入行号

2005及以后版本

select ROW_NUMBER()Over(ORDER BY UserID)  as rowId,UserID,UserName from  Users

 

2000版本

select    identity(int,1,1)   as   rowId, *   into   #tem  from  Users

select *   from   #tem 

drop   table   #tem

posted on 2010-01-15 13:51  imbob  阅读(259)  评论(0)    收藏  举报

导航