You should avoid the wm_concat function because it is undocumented and detected as a workaround in Oracle 8i times.
Since the old method with a custom aggregate function discovered by Tom Kyte here , there are several new workarounds shown in the examples below.
All of them are reproduced in this SQL script .
Workaround 1 - LISTAGG function, works in 11g:
select listagg(object_id,',') within group (order by rownum) id_string from cr_object_group_entries_vw
Workaround 2 - SYS_CONNECT_BY_PATH, works with 10g:
select id_string from ( select rn, substr(sys_connect_by_path(object_id, ','),2) id_string from (select object_id, rownum rn from cr_object_group_entries_vw) start with rn = 1 connect by prior rn + 1 = rn order by rn desc ) where rownum = 1
Workaround 3 - XMLAGG, works with 10g:
select replace( replace( replace( xmlagg(xmlelement("x",object_id)).getStringVal(), '</x><x>', ',' ), '<x>', '' ), '</x>', '' ) id_string from cr_object_group_entries_vw
PS I didnβt know exactly in which version of Oracle sys_connect_by_path and xmlagg were introduced, but both work well on 10.2.0.4.0