Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save romelgomez/2776df1338bfbdbb8c4f3ea05c33f9a3 to your computer and use it in GitHub Desktop.

Select an option

Save romelgomez/2776df1338bfbdbb8c4f3ea05c33f9a3 to your computer and use it in GitHub Desktop.
merge array of arrays in postgresql with array_agg
--select ARRAY(select distinct unnest(array_agg(category.arr)))
select ARRAY(select distinct unnest(array[array[1,2,3], array[4,2,8]]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment