group_concat sql server
snippet in sql

how to use group_concat in sql server

user2664

SELECT STRING_AGG(column_name, ',') AS Result
FROM table_name

group_concat sql server

user2622

STRING_AGG ( expression, separator ) [ <order_clause> ]

<order_clause> ::=   
    WITHIN GROUP ( ORDER BY <order_by_expression_list> [ ASC | DESC ] )
    SELECT STRING_AGG(Genre, ',') AS Result
FROM Genres;
Result:

Result                                      
--------------------------------------------
Rock,Jazz,Country,Pop,Blues,Hip Hop,Rap,Punk