Group different rows in one by combining strings

前端 未结 1 2026
星月不相逢
星月不相逢 2021-02-05 01:41

I have a data set like this:

Column1  Column2
   1       A
   1       B
   1       C
   2       D
   2       E
   2       F
   2       G
   3       H
   3       I         


        
相关标签:
1条回答
  • 2021-02-05 02:01
     SELECT Column1, group_concat(Column2) FROM Table GROUP BY Column1
    

    group_concat takes an optional second argument (a string) to use as the concatenation separator if you don't want a single ',' character.

    0 讨论(0)
提交回复
热议问题