select * from (select rownum rm,a,b,c from table order by a desc) where rm>10 and rm<20

解决方案 »

  1.   

    排序后取M到N条记录:
    select * from(select rownum rn,a.* from table_name a order by colname [desc])
    where rn>=M and rn<=N
      

  2.   

    这样好像是先取得N-M个数据再按a排序,我是想先按a排好序再取N-M个数据。
      

  3.   

    select * from (select rownum rm,a,b,c from table order by a desc) where rm>9 and rm<20
      

  4.   

    select * from (select rm,t1.* from (select a,b,c from table order by a desc) t1)
    where rm>9 and rm<20
      

  5.   

    select * from (select rownum "RM",a,b,c from table order by a desc) where rm>9 and rm<20
    我试了没有问题
      

  6.   

    上面的排序语句都有问题,排序后rownum就乱了select * from (
    select rownum id,t.* from (select a,b,c from table order by a desc) t where id<21
    ) where id>10;