最佳sql server 分页查询

时间:2023-03-08 20:42:01

用关键字查询 并作为条件是最快的,比其他嵌套select性能都要好

select top 100 id , name from tablex where id >preid order by id

preid是上次查询的结果的最大值

这样的好处是查询速度是最快的,超过任何嵌套select

缺点是只能挨个查,不能跳页查