oracle 分页

oracle分页操作

select * from emp;

select * from emp where rownum<=3;

--方式1 子查询分页:需要改动原语句
select * from (
       select rownum rn,emp.* from emp where rownum<=5
) where rn>=3;

--方式2 三层嵌套子循环
select * from(
       select t.*,rownum rn from
            (select * from em) t 
            where rownum<=5
 )where rn>=3;
   
 --方式3 
select * from(
         select t.*,rownum rn from
                (select * from emp) t
        ) where rn>=3 and rn<=5;--或者用between 3 and 5

你可能感兴趣的:(oracle 分页)