MySQL: group_concat

GROUP_CONCAT returns a string result with the concatenated non-NULL values from a group. It returns NULL if there are no non-NULL values. You can get the concatenated values of expression combinations. To eliminate duplicate values, use the DISTINCT clause. The default separator between values in a group is comma (“,”). To specify a separator explicitly, use SEPARATOR followed by the string value that should be inserted between group values. To eliminate the separator altogether, specify SEPARATOR ”. The result is truncated to the maximum length that is given by the group_concat_max_len system variable, which has a default value of 1024.

Leave a Reply