标签:
DECLARE @pageSize INT ; DECLARE @pageIndex INT ; SET @pageSize = 5 SET @pageIndex =2 ; --第二页,每页显示5条数据 SELECT * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY CreateDate ASC ) AS ‘rowNumber‘ , * FROM dbo.Task_Info ) AS temp WHERE rowNumber BETWEEN ( ( ( @pageIndex - 1 ) * @pageSize ) + 1 ) AND ( @pageIndex * @pageSize )
标签:
原文地址:http://www.cnblogs.com/niuzaihenmang/p/5627537.html