Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

group_concat sql server

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
Source by database.guide #
 
PREVIOUS NEXT
Tagged: #sql #server
ADD COMMENT
Topic
Name
8+3 =