作者:佚名 来源:不详 发布时间:2006-11-21 7:23:10 发布人:yzlangzi |
1DECLARE @pagenum AS INT, @pagesize AS INT
2SET @pagenum = 2 3SET @pagesize = 3 4SELECT * 5FROM (SELECT ROW_NUMBER() OVER(ORDER BY newsid DESC) AS rownum, 6 newsid, topic, ntime, hits 7 FROM news) AS D 8WHERE rownum BETWEEN (@pagenum-1)*@pagesize+1 AND @pagenum*@pagesize 9ORDER BY newsid DESC aspx里面只需给SQL传入pageid和条数即可。 |