select top 页大小 *
from table1
where id>
(select max (id) from
(select top ((页码-1)*页大小) id from table1 order by id) as T) order by id
sql精湛分页语句
本文介绍了一种使用SQL进行分页查询的优化方法,通过在内层查询中使用TOP子句结合外部查询的条件筛选,有效减少数据检索范围,提高查询效率。
本文介绍了一种使用SQL进行分页查询的优化方法,通过在内层查询中使用TOP子句结合外部查询的条件筛选,有效减少数据检索范围,提高查询效率。
select top 页大小 *
from table1
where id>
(select max (id) from
(select top ((页码-1)*页大小) id from table1 order by id) as T) order by id

被折叠的 条评论
为什么被折叠?