Oracle 分页
Posted 细心,耐心
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle 分页相关的知识,希望对你有一定的参考价值。
SELECT * FROM
(
SELECT A.*, ROWNUM RN
FROM (SELECT * FROM TABLE_NAME) A
WHERE ROWNUM <= 40
)
WHERE RN >= 21
-----------------------------------------------------------------------
SELECT * FROM
(
SELECT A.*, ROWNUM RN
FROM (SELECT * FROM TABLE_NAME) A
)
WHERE RN BETWEEN 21 AND 40
select e.*,rownum from emp e order by sal;
select e.*,rownum from (select * from emp order by sal) e;
查询一结果:
查询二结果:
以上是关于Oracle 分页的主要内容,如果未能解决你的问题,请参考以下文章