select * from t where rownum>20 and rownum<31 order by c desc(asc)

解决方案 »

  1.   

    楼上的朋友,你哪个SQL好像不对,我执行了一个,好像取不到21到30的记录。
    我改了一下。看这个行吗
    select * from 
    (
    select rownum as num,a.* from t a  order by a.c
    ) b
    where b.num >20 and b.num<=30
      

  2.   

    kokengun(蜗牛)
    你的写法也不对。要先排序再取rownum
      

  3.   

    这样做:测试过。正确的
    select * from
    (
    select rownum as num ,j.* from 
    (
    select * from t   order by c
    ) j
    )
    where num >20 and num<=30
      

  4.   

    select * from (select rownum rn,a.* from t a order by a.c where rn <=30) where rn>=21
      

  5.   

    (select * from(select * from (select from t  order by c) where rn <31) where rn>20