获取当前行的唯一
SELECT
ROW_NUMBER() OVER (ORDER BY LastName, FirstName) AS RowNumber,
*
FROM
dbo.Customers
ROW_NUMBER() OVER (ORDER BY LastName, FirstName) AS RowNumber,
*
FROM
dbo.Customers
按条件条件获取
SELECT TOP 2 * FROM (SELECT
ROW_NUMBER() OVER (ORDER BY LastName, FirstName) AS RowNumber,
*
FROM
dbo.Customers) _myResults
WHERE
RowNumber > 2
把上面稍微改改就是我们新分页了。。ROW_NUMBER() OVER (ORDER BY LastName, FirstName) AS RowNumber,
*
FROM
dbo.Customers) _myResults
WHERE
RowNumber > 2
速度也是相当不错的。。
文章是这的。。
http://www.singingeels.com/Articles/Pagination_In_SQL_Server_2005.aspx