SELECT TOP 頁大小 *
FROM table1
WHERE id NOT IN
(
SELECT TOP 頁大小*(頁數(shù)-1) id FROM table1 ORDER BY id
)
ORDER BY id
SELECT TOP 頁大小 *
FROM table1
WHERE id >
(
SELECT ISNULL(MAX(id),0)
FROM
(
SELECT TOP 頁大小*(頁數(shù)-1) id FROM table1 ORDER BY id
) A
)
ORDER BY id
SELECT TOP 頁大小 *
FROM table1
WHERE ID =
(
SELECT ISNULL(MIN(ID),(SELECT MAX(ID) FROM table1 ))
FROM
(
SELECT TOP (頁大小*(頁數(shù)-1)) ID FROM tbl_files ORDER BY ID DESC
) A
)
ORDER BY ID DESC
SELECT TOP 頁大小 *
FROM
(
SELECT ROW_NUMBER() OVER (ORDER BY id) AS RowNumber,* FROM table1
) A
WHERE RowNumber > 頁大小*(頁數(shù)-1)