select column from (select rownum,column from table order by column asc) where rownum <= N

解决方案 »

  1.   

    select * from table
    where rownum <=N
      

  2.   

    select * from tablename where rownum<=Nrownum不能直接写等于某个值
      

  3.   

    oracle and sql server are not the same in many ways.
      

  4.   

    select * from TablleName where rownum<='n'
    应该是这样吧,可以完成同样的功能.
      

  5.   

    select * from test  where rownum<=1;/*选取第一行*/
    在8.0.5通过
      

  6.   

    select * from tablename where rownum<=N
      

  7.   

    老兄,一看你用的就是SQL SERVER的语法,
    oracle 中去N行应该这样用:
    select * from tablename where rownum<=N
      

  8.   

    取前n行的语法是:select * from table_name where rownum<=n;
    第一行有两种写法:select * from table_name where rownum<=1;
                      select * from table_name where rownum=1;(其他行均不可用该法)
      

  9.   

    select * from tablename where rownum<=N
      

  10.   

    楼主请小心,以上各位人兄所定都对,但所涉及order by就要小心使用了from:luckysxn(风子)应该比较安全 select column from (select rownum,column from table order by column asc) where rownum <= 1