sqlserver2000 数据库分页查询[根据网上搜索到得sql修改,亲测,可用]

SELECT TOP 页大小 *
FROM TestTable
WHERE (ID >
(SELECT case when count(0) < 页大小 then 0 else MAX(id)
FROM (SELECT TOP 页大小*(页数-1) id
FROM 表
ORDER BY id) AS T))
ORDER BY ID

posted @ 2013-07-24 19:55  坚固66  阅读(144)  评论(0编辑  收藏  举报