Thread: Aggregate function for a text column

Aggregate function for a text column

From
"sathish kumar shanmugavelu"
Date:
Dear Group,
    I have a table with a column named Supplier_Name
 
    supplier_name
    ==========
Praveen Systems
Zigma Systems
HCL Tech
Vela Book Shop
Senthil Books
Usha Electricals
National Scientific Company
Indian Oil Corporation

Now i want a result like below
      'Praveen Systems, Zigma Systems, HCL Tech, Vela Book Shop, Senthil Books, Usha,
Electricals, National Scientific Company, Indian Oil Corporation'

is it possible in a single query

help me
--
Sathish Kumar.S
SpireTEK

Re: Aggregate function for a text column

From
Michael Fuhr
Date:
On Sat, Mar 04, 2006 at 10:15:46AM +0530, sathish kumar shanmugavelu wrote:
> Now i want a result like below
>       'Praveen Systems, Zigma Systems, HCL Tech, Vela Book Shop, Senthil
> Books, Usha,
> Electricals, National Scientific Company, Indian Oil Corporation'

Will something like this work?

SELECT array_to_string(ARRAY(SELECT supplier_name FROM tablename), ', ');

--
Michael Fuhr