sql server高效分页语句

发布时间:2021-01-22编辑:脚本学堂
sql server高效分页语句,大家测试下看看效果如何。
复制代码 代码如下:
sql="select top 页大小 *
      from table1
      where id<=
            (select min (id) from
            (select top ((页码-1)*页大小) id from table1 order by id desc) as
       T
             )
        oeder by id desc";