sql分页逻辑top是最快速的

 

复制代码
-- 用top分页是最快速的分页查询方式
-- (PageIndex - 1) * PageSize+1
--PageIndex=1  PageSize=10  key=autoid  TableName=customers


select top      10 *  from  customers
where [autoid] >=(select max([autoid]) from (
select top       ((2 - 1) * 10+1) [autoid] from  customers
where 1=1  
) as tempTableName) 
复制代码

 

posted on   苏上话  阅读(794)  评论(0编辑  收藏  举报
努力加载评论中...

点击右上角即可分享
微信分享提示