SET @SQL='select top '+CAST(@PageSize AS NVARCHAR(20))+' *
FROM (select row_number()
OVER(order by TestDate desc) as rownumber,*
FROM #TEMPITEM) temp_row
WHERE rownumber>'+CAST(((+@pageIndex+-1)*+@pageSize) as NVARCHAR(20))
SQL SERVER分页查询动态sql
最新推荐文章于 2023-10-20 15:48:59 发布