想查询emp这张表,先按工资(sal)进行排序后的,第5条到第10条之间的记录。

解决方案 »

  1.   

    select * from 
    (select a.*,rownum row_num from 
     (select * from emp t order by sal) a
    ) b where b.row_num between 5 and 10;
      

  2.   

    select * from (select a.*, rownum rn from (select * from emp t order by sal) a where rownum <= 10) where rn>5
      

  3.   

    我自己也弄出来了,不过还是谢谢了!
    select * from(select empno,ename,job,sal,deptno,rownum rw from (select * from emp order by sal) where rownum<10) where rw>5