select test2.* from ( select top 3 * from Test) test2
where test2.id not in ( select top 1 Test.id from Test) ;
查询表Test的第2到第3行
本文介绍了一种使用SQL实现从第二到第三条记录的特定分页查询方法。通过结合使用子查询与NOT IN来定位所需的数据行,适用于需要精确控制返回结果集的应用场景。
select test2.* from ( select top 3 * from Test) test2
where test2.id not in ( select top 1 Test.id from Test) ;
查询表Test的第2到第3行

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