MySQL Group_concat equivalent in T-SQL and Oracle
- Joel Lipman
- Databases
- Hits: 15628
Unfortunately I make a living using Microsoft and Oracle products. I shouldn't say unfortunately as I don't see myself doing any other job and it beats daytime television any day.
I use this quite a lot so I thought I'd put an article here somewhere. Based on the following concept:
RowID column_to_return_as_string --------- -------------------------- 1 Me 2 Myself 3 I -- to be returned as RowID my_field_name --------- -------------------------- 1 Me,Myself,I
- RowID column_to_return_as_string
- --------- --------------------------
- 1 Me
- 2 Myself
- 3 I
- -- to be returned as
- RowID my_field_name
- --------- --------------------------
- 1 Me,Myself,I