select top pageSize, * from (SELECT row_number() over(order by id desc) as rownumber,*FROM tb1) A where rownumber > (pageIndex-1)*pageSize