代码如下:
declare @PageSize int;
declare @PageNum int;
set @PageSize = 20;
set @PageNum = 300;
--------------------------------------------------
select *
from (select ROW_NUMBER() over(order by Created desc) as RowNumber
,*
from T_Api_TB_Trade) as tb
where RowNumber between ((@PageNum - 1) * @PageSize + 1) and (@PageSize * @PageNum)
--------------------------------------------------