can I know how do i merge arrays according to an identifier:
Column1 Column2
--------------------------
1 {"a","b"}
1 {"c"}
2 {"d"}
2 {"w"}
output:
Column1 Column2
--------------------------
1 {"a","b","c"}
2 {"d","w"}
Have tried array_agg but that is not the appropriate function for merging the array. using version 8.4 at the moment.
And assuming your table is “a” and the columns affected are “n” and “t”: