从表A查询出第30到第39条记录
select top 10 * from (select top 39 * from A order by id asc) t order by id desc
select top 10 * from A where id not in (select top 30 id from A order by id asc) order by id asc
本文介绍了一种在SQL中实现特定范围记录查询的方法,通过使用子查询和联合查询的方式,可以有效地获取表A中第30到第39条记录。此方法避免了直接使用LIMIT指令可能存在的限制。
8万+

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



