Concatenating several rows

From: "Pierre Thibaudeau" <pierdeux(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Concatenating several rows
Date: 2007-01-30 02:49:56
Message-ID: 74b035bb0701291849w60e84a6anf7151a1b0e39dece@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

SELECT name FROM pseudonyms WHERE person_id=125;

I know in advance that this query yields between 0 and 5 rows of
results, depending on the actual person_id.

How can I concatenate those results into one text string? Something like:

SELECT array_to_string( (SELECT name FROM pseudonyms WHERE person_id=125), ' ');

which doesn't work...

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message George Pavlov 2007-01-30 03:30:02 Re: Concatenating several rows
Previous Message operationsengineer1 2007-01-29 22:48:18 Re: Thanks All! - Seconded