SQL 2005的行號

得到記錄的行號,不考慮重復記錄
select ROW_NUMBER() OVER(order by Name) as RowIndex,* from SysObjects
得到記錄的序號
select RANK() OVER(order by Name) as RowIndex,* from SysObjects

原文地址:https://www.cnblogs.com/wangxiaohuo/p/585107.html