ORACLE 当中有三到四条数据.
SQL怎么写..才能.分别取得,,第二条..第三条.第四条数据.
第一条..     selest t.* from AA where rownum = 1 
第二条..    SQL 怎么写?
第三条..     ....?
第四条..     ....?

解决方案 »

  1.   

    selest t.* from AA where rownum = 2;
    selest t.* from AA where rownum = 3;selest t.* from AA where rownum = 4;
      

  2.   

    selest t.* from AA where rownum <= 2; 
    minus
    selest t.* from AA where rownum <= 1;
     ...
    selest t.* from AA where rownum <= n; 
    minus
    selest t.* from AA where rownum <= n-1;
      

  3.   

    三楼..   <= n-1  是把1到n条,都显示出来.我现在只想要的是..第二条(只有第二条.第一条不要.),第三条(只有第三条.一二条不要.)
      

  4.   

    或者:
    select * from
    (select rownum rn,t.* from aa t where rownum<=3) tt
    where rn=3;
      

  5.   

    加个子查询 应该可以做到了
    select * from (select rownum num,AA.* from AA) t where t.num=2
    select * from (select rownum num,AA.* from AA) t where t.num=3
    select * from (select rownum num,AA.* from AA) t where t.num=4
      

  6.   

    恩..好谢谢 bzszp了.一会散分.