Sql Paging for MSSQL

Reference from http://www.codeproject.com/Articles/18148/SQL-Server-2005-Paging-Results

With Cust AS ( SELECT CustomerID, CompanyName,
    ROW_NUMBER() OVER (order by CompanyName) as RowNumber
    FROM Customers )
select *
from Cust
Where RowNumber Between 20 and 30

你可能感兴趣的:(paging)