use function minus:
select * from jjaj where rownum<=20
minus
select * from jjaj where rownum<10

解决方案 »

  1.   

    select rownum from jjaj where  rownum <=3 minus 
    select rownum from jjaj where  rownum >2 ;这条语句为什么还能把rownum=2的选择出来:
      

  2.   

    因为rownum==2的记录不在集合select rownum from jjaj where  rownum >2 中,此集合中最小的rownum是3!
      

  3.   

    select rownum from jjaj where  rownum >2 根本就不会返回任何结果,当然有rownum=2的了。因为满足select rownum from jjaj where  rownum <=3 。懂了吧
      

  4.   

    select * from (select a.*,rownum as id  from jjaj a) where id between 10 and 20;