oracle分页

分页大致分为如下几个步骤:

1、rownum分页

select * from emp;

 

2、找到rownum属性的值

select a1.*,rownum rn from (select * from emp) a1;

 

3、查询rn小于10的数据

select * from (select a1.*,rownum rn from (select * from emp) a1) a2 where a2.rn<10;

 

4、限定查询的rn大于6的数据

select * from (select * from (select a1.*,rownum rn from (select * from emp) a1) a2 where a2.rn<10)a3 where a3.rn>6;

你可能感兴趣的:(oracle)