[ad_1]
I have a SQL table, and one column of the table has type text[]. I want to create write a query that will create a new table, which consists of all arrays flattened and concatenated. Ex: If there are 3 items in the table, and the array entry for each of those items is [1, 2, 3], NULL, [1, 4, 5], I want the result set to be [1, 2, 3, 1, 4, 5].
UNNEST seems like it could be useful here. But, I can’t find a way to apply the function to every array in the table. Essentially, I want to “map” this function over every row in the table. Can anyone point me in a good direction?
Thanks!
[ad_2]