Re: Concatenation through SQL - Mailing list pgsql-sql

From Andreas Kretschmer
Subject Re: Concatenation through SQL
Date
Msg-id 20071221105813.GA18247@KanotixBox
Whole thread Raw
In response to Concatenation through SQL  ("Philippe Lang" <philippe.lang@attiksystem.ch>)
List pgsql-sql
Philippe Lang <philippe.lang@attiksystem.ch> schrieb:

2 ways:

* You can use something like this:

test=*# select * from a;id | val
----+----- 1 | foo 2 | bar
(2 rows)

test=*# select array_to_string(array(select val from a), ', ');array_to_string
-----------------foo, bar
(1 row)


* comma-aggregate, see
http://www.zigo.dhs.org/postgresql/#comma_aggregate


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


pgsql-sql by date:

Previous
From: "Philippe Lang"
Date:
Subject: Concatenation through SQL
Next
From: "Pavel Stehule"
Date:
Subject: Re: Concatenation through SQL