Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Thu, Nov 10, 2011 at 8:34 AM, Thomas Kellerer <spam_eater@xxxxxxx> 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. 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux