一条sql肯定办不到
要用存储过程另外建立一张表,然后把这些选进去

解决方案 »

  1.   

    create or replace function get_char
     return varchar2
     is
     col1 varchar2(300);
     begin
     for cur in(select field1 from table_name )
     loop
     col1:=col1||cur.id1||',';
     end loop;
     col1:=rtrim(col1);
    then:
    select min(row),get_char() from table_name;
     col1:=substr(col1,1,length(col1)-1);
     return col1;
     end;