Skip to content

Instantly share code, notes, and snippets.

@AnjaneyuluBatta505
Created November 16, 2018 12:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save AnjaneyuluBatta505/a05293f1e2cef33248b6fcd1850f5f58 to your computer and use it in GitHub Desktop.
Save AnjaneyuluBatta505/a05293f1e2cef33248b6fcd1850f5f58 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