Presto equivalent of MySQL group_concat Presto equivalent of MySQL group_concat mysql mysql

Presto equivalent of MySQL group_concat


Try using this in place of group_concat in Presto ::

select   a,  array_join(array_agg(b), ',')from tablegroup by a


Also, if you're looking for unique values only – an equivalent to group_concat(distinct ... separator ', ') – try this:

array_join(array_distinct(array_agg(...)), ', ')


There's no function as of this answer, though the feature has been requested.

The closest equivalent is mentioned in your question.

WITH tmp AS (SELECT 'hey' AS str1UNION ALLSELECT ' there')SELECT array_join(array_agg(str1), ',', '') AS joinedFROM tmp