select b.* from 
(
  select a.*,rownum  as sortnum 
  from resumes A 
  where rownum<=60 
  order by a.resume_id desc
) b
where b.sortnum>=40
这样就可以了

解决方案 »

  1.   

    楼上是错误的
    你的roder by无效
      

  2.   

    楼上的,你的程序执行逻辑是这样的,现找到60条记录,然后把这60条记录order by了。
    正确的方法是要写2层嵌套。
    select *
      from (select rownum myrownum, tt.*
               from (
                     your sql 
                     ) tt
              where rownum < 60) ttt
     where myrownum >= 40