select * from (select rownum r ,tbname.* from tbname order by time desc ) where r between 40 and 60
/

解决方案 »

  1.   

    括号内的排序了,括号外的没有排序,当然不对了按照wylwyl1130(落雪山林)写的就ok了
      

  2.   

    oracle中没有top的概念.如果想返回前10条,用where rownum<=10来实现.
      

  3.   

    怎么sql server的问题跑到这里来了
      

  4.   

    问题:子查询排序  父查询未排序
    方法:用RowNum来限制取数行数
      

  5.   

    select * from (
      select rownum num,a.*
       from tablename a
    )where num>=20 and num<=40
      

  6.   

    select top 20 id from table where id not in(select top 40 id from table order by time desc)你再看看,这永远是找到1-20的记录啊,而不是40-60的记录,更改:
    select top 20 id from table  order by id desc