1.所有記錄的分頁:
SELECT TOP 頁大小 *
FROM
Users
WHERE
(ID NOT IN (SELECT TOP (頁大小*(頁數-1)) ID FROM Users ORDER BY ID DESC)) //skip(頁大小*(頁數-1)) 條記錄
ORDER BY
ID DESC
2.符合條件記錄的分頁(注意此時你的查詢條件要分布在兩個查詢語句中,謹記)
SELECT TOP 頁大小 *
FROM
Users
WHERE
+你的查詢條件
AND ( ID NOT IN (SELECT TOP (頁大小*(頁數-1)) ID where + 你的查詢條件 FROM Users ORDER BY ID DESC))
ORDER BY
ID DESC