Обсуждение: Aggregate function for a text column

Поиск
Список
Период
Сортировка

Aggregate function for a text column

От
"sathish kumar shanmugavelu"
Дата:
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

От
Michael Fuhr
Дата:
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