how to generate a list of distinct scalar values from a column which type is array

Поиск
Список
Период
Сортировка
От Sergio Andreozzi
Тема how to generate a list of distinct scalar values from a column which type is array
Дата
Msg-id 2cfc7c940702220338h3eb4ec97p8cd759cb7a36d775@mail.gmail.com
обсуждение исходный текст
Ответы Re: how to generate a list of distinct scalar values from a column which type is array  (David Fetter <david@fetter.org>)
Список pgsql-general
Dear all,

given a column which type is for instance varchar(20)[], is it possible via SQL to generate the list of distinct scalar values?


e.g.:
             col1
row 1: (aaa, bb, c)
row 2: (dddd, eeee)
row 3: (aaa, eeee)

the query should return:

aaa
bb
c
dddd
eeee

if not, I guess the approach is to use stored procedure. Any code snippet/suggestion?

Thanks, Sergio

В списке pgsql-general по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Esay question, about the numeric format
Следующее
От: Russ Brown
Дата:
Сообщение: Re: postgresql vs mysql