EXPERT RESPONSE
No, you will need to write a user-defined function with a VARRAY or DECODE for this. Something like this might work:
create or replace function concat( cur sys_refcursor )return varchar2
is retval varchar2(32767); hold varchar2(80);begin loop fetch
cur into tmp; exit when cur%notfound; ret := ret || ',' || hold;
end loop; return retval;end;/ select distinct substr
(concat( cursor( select userid from users outer where e.usergrp
= outer.usergrp ) ),1,40) useridsfrom users e;
|