This content has been marked as final. Show 1 reply
That's called string aggregation.
There are several solutions on [asktom.oracle.com|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402]
I recommend the first solution on that page, the user-defined function STRAGG. You can copy it verbatim once for all, and then use it everywhere, like this:
In Oracle 10 (and up), you may already have a function named WM_CONCAT available, which is equivalent to STRAGG.
SELECT c1 , STRAGG (c2) FROM table_x GROUP BY c1;