select * from (select * from table1 order by rq desc) as table_alias where rownum<6;
oracle8.17通过;

解决方案 »

  1.   

    试试
    select a.* from (select b.* from table1 b order by rq desc) as a where a.rownum<6;
      

  2.   

    贴主所说的faq中的语句也没错误,在oracle815下测试通过。
    不用别名应该也没错的。我怀疑可能是 版本的限制。没用过804,不知道能不能用子查询。
      

  3.   

    9i下:
    SQL> select * from (select * from student order by sbirthday desc) as stu where rownum<6;
    select * from (select * from student order by sbirthday desc) as stu where rownum<6
                                                                  *
    ERROR 位于第 1 行:
    ORA-00933: SQL 命令未正确结束
    ???
      

  4.   

    this is a limitation of Oracle 8.0.x, which doesn't support sorting in subqueries. Only versions 8.1.x are able to do so.
      

  5.   

    this is a limitation of Oracle 8.0.x, which doesn't support sorting in subqueries. Only versions 8.1.x are able to do so.
      

  6.   

    不要as就行了,试一下:
    select * from (select * from student order by birthday desc)  stu where rownum<6;
      

  7.   

    楼上的,用不用AS都没关系,两种语法都支持。
    根据 l2g32003(T2-X) 所说,这是8.0.X版本oracle的限制,
    不能在子查询里用order by的。
    还有flymoon(花儿月)同学,你进行拷贝粘贴的用意何在呢??????