CREATE PROC ZDY_FY(@Pages INT, @pageRow INT) --@Pages第几页 @pageRow每页显示几行 AS BEGIN DECLARE @starNum INT, --开始行 @endNum INT --结束行 SET @starNum = (@Pages -1) * @pageRow SET @endNum = @starNum + @pageRow SELECT * FROM ( SELECT ROW_NUMBER() OVER(ORDER BY DJBH) AS ROWNUM, * FROM VW_LSXHMX ) AS A WHERE A.ROWNUM >= @starNum AND A.ROWNUM <= @endNum END /* EXEC zdy_fy 20000,30 --100万数据量,效率慢执行时间6秒
时间: 2024-11-09 00:06:31