postgresql "concatenate rows into string variable" code example
Example 1: postgresql combine values in one field
SELECT movie, string_agg(actor, ', ') AS actor_list
FROM tbl
GROUP BY 1;
Example 2: how to combine diff colmun value using group by postgres
SELECT movie, string_agg(actor, ', ' ORDER BY actor) AS actor_list
FROM tbl
GROUP BY 1;