一、基于MS SQL SERVER 的分页
I、MSSQL2000
1、利用ID大于多少
SELECT TOP pageSize * FROM TABLE
WHERE ID>
(SELECT MAX(ID) FROM (SELECT TOP ((pageNow-1)*pagesize) * FROM TBALE ORDER BY ID) AS T)
ORDER BY ID
2、排除ID法
SELECT TOP pageSize * FROM SCORE
WHERE (ID NOT IN (SELECT TOP ((pageNow-1)*pageSize) ID FROM SCORE ORDER BY ID))
ORDER BY ID
II、MSSQL2005
1、利用rownumber进行分页
SELECT * FROM
(SELECT row_number() over(ORDER BY ID) as rownum ,* FROM TABLE) AS T
WHERE ROWNUM BETWEEN 1 AND 3
二、基于MYSQL的分页
三、基于Oracle的分页