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

Поиск
Список
Период
Сортировка
От David Johnston
Тема 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
Дата
Msg-id 009101cc9fcf$5d086660$17193320$@yahoo.com
обсуждение исходный текст
Ответ на 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  (Henry Drexler <alonup8tb@gmail.com>)
Список pgsql-general

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Henry Drexler
Sent: Thursday, November 10, 2011 8:42 AM
To: Thomas Kellerer
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] 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

 

 

On Thu, Nov 10, 2011 at 8:34 AM, Thomas Kellerer <spam_eater@gmx.net> wrote:

 

 

SELECT type,
      string_agg(color, ',') as organized_by_type
FROM clothes
GROUP BY type;

 

wow, yes that is cleaner.

 

Thank you for taking the time - obviously I need to read through the string functions again. 

 

 

 

It isn’t a “String Function” but an “Aggregate Function”;  classification can be a pain sometimes – especially when more than one category could readily apply.

 

David J.

 

 

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: troubleshooting PGError
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: select from dynamic table names