使用自定义函数:
create or replace function zdy(bm varchar2) return varchar2 is 
begin
  declare 
   c1 is select col2 from tablename where col1=bm;
   str varchar2(500); 
   tmpstr varchar2(20); 
  begin
   str:='';
   open c1;
   loop 
   fetch c1 into tmpstr;
   exit when c1%notfound;
   str:=str||tmpstr;
   end loop;
   close c1;
   return str;
  end;
end;sql>select distinct col1,zdy(col1) from tablename