Istnieje wiele sposobów na wykonanie agregacji ciągów w celu utworzenia listy oddzielonej przecinkami — zobacz to link po więcej szczegółów . Na podstawie przykładu z linku spróbuj:
SELECT x.id,
LTRIM(MAX(SYS_CONNECT_BY_PATH(x.language,','))
KEEP (DENSE_RANK LAST ORDER BY curr),',') AS employees
FROM (SELECT a.id,
b.language,
ROW_NUMBER() OVER (PARTITION BY a.id ORDER BY b.language) AS curr,
ROW_NUMBER() OVER (PARTITION BY a.id ORDER BY b.language) -1 AS prev
FROM TABLE_1 a
JOIN TABLE_2 b ON b.id = a.langid) x
GROUP BY x.id
CONNECT BY prev = PRIOR curr AND x.id = PRIOR x.id
START WITH curr = 1;