oracle 分页查询语句

 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

猜你喜欢

转载自blog.csdn.net/java_MrZHANG/article/details/82382571