SELECT TOP 页大小 *
FROM table1
WHERE id NOT IN
(
SELECT TOP 页大小*(页数-1) id FROM table1 ORDER BY id
)
ORDER BY id
SELECT TOP 页大小 *
FROM table1
WHERE id >
(
SELECT ISNULL(MAX(id),0)
FROM
(
SELECT TOP 页大小*(页数-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 (页大小*(页数-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 > 页大小*(页数-1)