Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romelgomez/2776df1338bfbdbb8c4f3ea05c33f9a3 to your computer and use it in GitHub Desktop.
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