Reputation: 4755
Given something such as the following:
select array[array[1, 2], array[3, 4]]
Which returns
{{1,2},{3,4}}
I would like to know how to flatten this to a single array as:
{1,2,3,4}
Upvotes: 3
Views: 1790
Reputation: 1632
This is one way to achieve it:
select array(select unnest(array[array[1, 2], array[3, 4]]));
Result:
{1,2,3,4}
Upvotes: 2