3

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}

1 Answer 1

2

This is one way to achieve it:

select array(select unnest(array[array[1, 2], array[3, 4]]));

Result:

{1,2,3,4}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.