declare @pageIndex int = 1,
@pageSize int =10
select * from (
select row_number() over(order by 排序字段 asc) as num,*
from 表名
) temp_row where num between (@pageIndex-1)*@pageSize+1 and (@pageSize*@pageIndex)
declare @pageIndex int = 1,
@pageSize int =10
select * from (
select row_number() over(order by 排序字段 asc) as num,*
from 表名
) temp_row where num between (@pageIndex-1)*@pageSize+1 and (@pageSize*@pageIndex)