I have a postgres query that returns a result set simplified as follows, with an id column and two json columns.
my_id | col_a | col_b
(integer) | (json) | (json)
----------------------------------------
5001 ["a", "b"] <NULL>
5001 <NULL> ["c", "d"]
My question is: what is the best way in postgres to aggregate this result? e.g.:
my_id | col_a | col_b
(integer) | (json) | (json)
----------------------------------------
5001 ["a", "b"] ["c", "d"]