return 1 formatted result instead of multiple results

From: Acm <alextabone(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: return 1 formatted result instead of multiple results
Date: 2007-08-31 08:41:43
Message-ID: 1188549703.682362.232990@q4g2000prc.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I want to query a column in a table that returns multiple records,
append the values of that column in a comma separated string, and
return that string.

example: select * from people;
returns 3 results:
Mike
John
Dennis

and I want one result to be "Mike,John,Dennis".

How can I format my results in this way using SQL (preferably not
stored functions)?

Thank you.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ottó Havasvölgyi 2007-08-31 09:10:48 Query the catalog
Previous Message Gregory Stark 2007-08-31 08:02:03 Re: E_BAD_ACCESS with palloc/pfree in base type