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

2011-11-10 Thread David Johnston
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@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

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

2011-11-10 Thread Henry Drexler
On Thu, Nov 10, 2011 at 8:34 AM, Thomas Kellerer 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.

[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

2011-11-10 Thread Thomas Kellerer
Henry Drexler, 10.11.2011 14:22: 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: typeorganized_by_type pants red,