Would it be possible to construct SQL to concatenate column values from multiple rows?
The following is an example:
Table A
PID A B C
There's also an XMLAGG
function, which works on versions prior to 11.2. Because WM_CONCAT
is undocumented and unsupported by Oracle, it's recommended not to use it in production system.
With XMLAGG
you can do the following:
SELECT XMLAGG(XMLELEMENT(E,ename||',')).EXTRACT('//text()') "Result"
FROM employee_names
What this does is
ename
column (concatenated with a comma) from the employee_names
table in an xml element (with tag E)