1. 以某个字段排序后查询第N到M条记录
select * from (select * from (select rownum, product_id, product_namefrom product order by product_id)where rownum <= 8 ) where product_id not in (select product_id from productwhere rownum<=2)
本文介绍了一种使用SQL进行分页查询的方法,通过ROWNUM结合子查询的方式实现从特定记录开始的数据检索,适用于需要从数据库中高效获取指定范围记录的应用场景。
1. 以某个字段排序后查询第N到M条记录
select * from (select * from (select rownum, product_id, product_namefrom product order by product_id)
被折叠的 条评论
为什么被折叠?