- 使用 row_number() 关键字分页
select top pageSize *
from (select row_number()
over(order by uId asc) as rownumber,*
from userInfo) temp_row
where rownumber>((pageIndex-1)*pageSize)
- 使用 offset /fetch next 分页
select * from userInfo
order by uId
offset ((pageIndex-1)*pageSize) rows
fetch next pageSize rows only