pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-sql@postgresql.org
Subject: Re: Concatenation through SQL
Date: Fri, 21 Dec 2007 11:58:13 +0100
Message-ID: <20071221105813.GA18247@KanotixBox> (raw)
In-Reply-To: <6C0CF58A187DA5479245E0830AF84F42337F97@poweredge.attiksystem.ch>
References: <6C0CF58A187DA5479245E0830AF84F42337F97@poweredge.attiksystem.ch>

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°



view thread (10+ messages)  latest in thread

Message-ID: <20071221105813.GA18247@KanotixBox>
Permalink:  ../20071221105813.GA18247@KanotixBox/
Also on:    postgresql.org/message-id/20071221105813.GA18247@KanotixBox

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: akretschmer@spamfence.net
  Subject: Re: Concatenation through SQL
  In-Reply-To: <20071221105813.GA18247@KanotixBox>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox