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}
This is one way to achieve it:
select array(select unnest(array[array[1, 2], array[3, 4]]));
Result:
{1,2,3,4}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With