如表(A)里的数据为
1
2
3
输出为   1,2,3

解决方案 »

  1.   

    SQL> select a1 from a;        A1
    ----------
             1
             2
             6
             8
             4
             56 rows selectedSQL> select substr(max(sys_connect_by_path(A1,',')),2) A1
      2  from (select A1,rownum rn from A)
      3  start with rn = 1
      4  connect by rn = prior rn+1;A1
    --------------------------------------------------------------------------------
    1,2,6,8,4,5SQL>
      

  2.   

    create procedure Test() astmp type;cursor c1 is
    select column
    from A;begin
      open c1;
      loop
      fetch c1 into tmp;
      exit when c1%notFound;
      end loop;
      if c1%rowcount != 0 then
         DBMS_PUT.PUT_LINE(',');
      end if;
      DBMS_PUT.PUT_LINE(tmp);  
      close cl;  
    end;