postgresql make each element in array distinct

Solutions on MaxInterview for postgresql make each element in array distinct by the best coders in the world

showing results for - "postgresql make each element in array distinct"
Paco
03 Sep 2017
1SELECT ARRAY(SELECT DISTINCT unnest(t_column)) FROM t_name;
Michele
15 Nov 2018
1SELECT ARRAY(SELECT DISTINCT e FROM unnest(ARRAY[a,b,c,d]) AS a(e))
2FROM ( VALUES
3  ('foo', 'bar', 'foo', 'baz' )
4) AS t(a,b,c,d);