Presto equivalent of MySQL group_concat

后端 未结 3 1289
灰色年华
灰色年华 2020-12-08 21:18

I\'m new to Presto and looking to get the same functionality as the group_concat function in MySQL. Are the following two equivalent? If not, any suggestions for how I can r

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 21:38

    Try using this in place of group_concat in Presto ::

    select 
      a,
      array_join(array_agg(b), ',')
    from table
    group by a
    

提交回复
热议问题