Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Sql Server join multiple column values and separate with comma

DECLARE @Table1 TABLE(ID INT, Value INT);
INSERT INTO @Table1 VALUES (1,100),(1,200),(1,300),(1,400);


SELECT ID , STRING_AGG([Value], ', ') AS List_Output
FROM @Table1
GROUP BY ID;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Sql #Server #join #multiple #column #values #separate #comma
ADD COMMENT
Topic
Name
4+4 =