I have the following table:
number word
====== ====
1 AAA
2 BBB
2 CCCC
4 CCCC
4 BBB
4 AAA
Now I want to create a new table, where a "number" only occurs in one row. The corresponding values in "word" should be converted to comma sepeareted string.
The result table:
number word
====== ====
1 AAA
2 BBB,CCCC
4 CCCCC,BBB,AAA
How can this solved with T-SQL? Thanks in advance.