select * from(
select *, row=row_number() over(order by 1)
from 你的表
)a where row between (页号 -1) * 每页页数 + 1 and 页号 * 每页页数
WITH PartsCTE AS(SELECT *, ROW_NUMBER() OVER(order by id DESC) as row FROM meetingroom)
SELECT * from PartsCTE where row between @intStart and @intStart+@intLength-1
--SQL SERVER 2005
DECLARE @pagenum AS INT, @pagesize AS INT
SET @pagenum = 2
SET @pagesize = 3
SELECT *
FROM (SELECT ROW_NUMBER() OVER(ORDER BY score DESC, speaker) AS rownum,
speaker, track, score
FROM SpeakerStats) AS D
WHERE rownum BETWEEN (@pagenum-1)*@pagesize+1 AND @pagenum*@pagesize
ORDER BY score DESC, speaker