Re: Combining several rows
От | Mike Mascari |
---|---|
Тема | Re: Combining several rows |
Дата | |
Msg-id | 40B1F437.4000806@mascari.com обсуждение исходный текст |
Ответ на | Combining several rows (Matthias Nagl <pg@mnagl.de>) |
Список | pgsql-general |
Matthias Nagl wrote: > Hello List! > > I would like to combine the contents of several rows of a subquery. After > several hours of search in the documentation and the internet I didn'T find a > solution and hope anyone can help. My problem: > > Let's say I've got a table in the following form: > > SELECT * FROM test; > > id | name > ----------- > 1 | abc > 2 | def > 3 | ghi > > For a table like this I am looking for a query that returns a result that > looks this way: > > name > ------------- > abc, def, ghi Joe Conway's crosstab() function in the 'tablefunc' contrib directory of the source tree is probably what you want. If you've installed by RPM, the postgresql-contrib package will have installed the SQL script to initialize the function in /usr/share/pgsql/contrib/tablefunc.sql. HTH, Mike Mascari
В списке pgsql-general по дате отправления: