v.24.7New Feature
Add groupConcat Aggregate Function with Custom Delimiter and Element Limit
Add aggregate functiongroupConcat. About the same asarrayStringConcat( groupArray(column), ',')Can receive 2 parameters: a string delimiter and the number of elements to be processed. #65451 (Yarik Briukhovetskyi).
Why it matters
Provides a convenient and efficient way to concatenate string values from grouped rows with a specified delimiter. It solves the problem of manually combining strings after aggregation, improving query expressiveness and performance.How to use it
Use<code>groupConcat</code> as an aggregate function with up to two parameters: the delimiter string and an optional limit on the number of concatenated elements. For example:SELECT groupConcat(column, ', ', 100) FROM table GROUP BY some_keyThis concatenates up to 100 values of
column per group, separated by ', '.