--A:数据条数 B:页码
select top A * from Table
where uid not in(select top ((B-1)*A) uid from Table)
列如:
每页显示5条数据 第一页查询语句如下
select top 5 * from adminInfo
where uid not in(select top ((1-1)*5) uid from adminInfo)
第二页
select top 5 * from adminInfo
where uid not in(select top ((2-1)*5) uid from adminInfo)
本文介绍了一种使用SQL进行分页查询的方法,通过不在指定数量的记录中选择的方式实现。示例展示了如何根据不同的页码来调整查询语句。

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



