Possible Duplicate:
How can I combine multiple rows into a comma-delimited list in Oracle?
Could some one please tell me how to achieve the following?
Table:
efforts_id cycle_name release_name
123 quarter march
123 half april
123 full april
124 quarter may
My expected output:
efforts_id cycle_name release_name
123 quarter,half,full march,april
124 quarter may
I am a beginner in oracle so not sure how to do this. Any help would be appreciated.
Thanks
You will want to use
LISTAGG()to perform this task. The other answers don’t remove any of the duplicate values, to remove the duplicates, you can use something similar to this:See SQL Fiddle with Demo