DECLARE @sUserNo NVARCHAR(20)
,@sBillNo NVARCHAR(50)
,@sStartDate DATETIME
,@sEndDate DATETIME
,@iPageSize INT = 20
,@iPageIndex INT = 1;
IF ISNULL(@iPageIndex,0) < 1
SET @iPageIndex = 1 ;
iF ISNULL(@iPageSize,0)<1
SET @iPageSize = 50 ;
SET @sEndDate = @sEndDate + 1
SELECT a.sBillNo FROM dbo.sdGmtOrderHdr A (NOLOCK) ORDER BY a.sBillNo DESC
OFFSET (@iPageIndex - 1) * @iPageSize ROW FETCH NEXT @iPageSize ROWS ONLY;
标签:iPageSize,SET,20,分页,sEndDate,sBillNo,SQL,iPageIndex From: https://blog.51cto.com/u_16159169/8956244