Hi,

Let's say we have a query like:

SELECT id, fk, str 
FROM foo

... which returns:

id    fk    str
---------------
1     1     a
2     1     b
3     2     c

Is there a pure SQL way of contactenating str values into a single string,
and get instead:

id    fk    str
---------------
1     1     a/b
2     12    c

I was thinking of something like:

SELECT id, fk, CONCAT(str || '/')
FROM FOO
GROUP BY fk

Do we have to use PL/PGSQL for that?

Thanks,


----------------------------------
Philippe Lang, Ing. Dipl. EPFL
Attik System
rte de la Fonderie 2
1700 Fribourg
Switzerland
http://www.attiksystem.ch

Tel:      +41 (26) 422 13 75 
Fax:      +41 (26) 422 13 76
Email:    [EMAIL PROTECTED]

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to