Re: plpgsql, I have a solution, want to see if there is a cleaner/better one. Taking vertical list and comma separating it onto a row

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: plpgsql, I have a solution, want to see if there is a cleaner/better one. Taking vertical list and comma separating it onto a row
Дата
Msg-id EF0A2F89-460B-42F3-8C9B-34E269D1D8EC@yahoo.com
обсуждение исходный текст
Ответ на plpgsql, I have a solution, want to see if there is a cleaner/better one. Taking vertical list and comma separating it onto a row  (Henry Drexler <alonup8tb@gmail.com>)
Список pgsql-general
On Nov 10, 2011, at 8:22, Henry Drexler <alonup8tb@gmail.com> wrote:

> I am thinking there is a better/simpler way, though this is what I have working:
>
> (postgres 9.1)
>
>
> I would like to have the list of colors for each type of clothing to be comma seperated in the end result.
>
> like this:
>
> type        organized_by_type
> pants     red, blue, orange
> shirt       black, gray
>
>
>

Use the STRING_AGG aggregate function instead of writing your own.

David J

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

Предыдущее
От: Henry Drexler
Дата:
Сообщение: Re: Re: plpgsql, I have a solution, want to see if there is a cleaner/better one. Taking vertical list and comma separating it onto a row
Следующее
От: Tom Lane
Дата:
Сообщение: Re: