select * from
(
select REC.*,ROWNUM RN
from
(select t.* from table t)REC
where ROWNUM <= num2
)
where RN >= num1
若果需要对结果集进行排序:可这样写,
select * from
(
select REC.*,ROWNUM RN
from
(select t.* from table t order by condition(你的条件))REC
where ROWNUM <= num2
)
where RN >= num1

本文介绍了一种使用SQL进行分页查询的方法,通过ROWNUM实现指定范围内的数据检索,并支持结果集排序。
31万+

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



