I have two tables as decribe bellow:
Table1
id | table2_id | value
1 | 1 | AAA
2 | 1 | BBB
3 | 1 | CCC
Table2
id | value
1 | XXXX
and I want to update Table2
with combined value from Table1
.
OUTPUT Expected on Table2
id | value
1 | AAA,BBB,CCC
How can I do or there are the best way to get expected result that explained above just using TSQL in sql server?