1. All versions of Oracle can use the wm_concat() function:
SELECT pos_preeqid,wmsys.wm_concat(to_char(wkid)) FROM worker where pos_preeqid=62 and wkid<40000 GROUP BY pos_preeqid;
2. If it is 11g, use the listagg() within group() function:
SELECT pos_preeqid, ListAgg(to_char(wkid),',') WITHIN GROUP(ORDER BY pos_preeqid) AS xCity FROM worker where pos_preeqid=62 and wkid<40000 GROUP BY pos_preeqid;
{{o.name}}
{{m.name}}