pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Aggregate function for a text column
2+ messages / 2 participants
[nested] [flat]

* Aggregate function for a text column
@ 2006-03-04 04:45  sathish kumar shanmugavelu <sathishkumar.shanmugavelu@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: sathish kumar shanmugavelu @ 2006-03-04 04:45 UTC (permalink / raw)
  To: pgsql-jdbc

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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Aggregate function for a text column
@ 2006-03-04 05:00  Michael Fuhr <mike@fuhr.org>
  parent: sathish kumar shanmugavelu <sathishkumar.shanmugavelu@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Fuhr @ 2006-03-04 05:00 UTC (permalink / raw)
  To: sathish kumar shanmugavelu <sathishkumar.shanmugavelu@gmail.com>; +Cc: pgsql-jdbc

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-03-04 05:00 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-03-04 04:45 Aggregate function for a text column sathish kumar shanmugavelu <sathishkumar.shanmugavelu@gmail.com>
2006-03-04 05:00 ` Michael Fuhr <mike@fuhr.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox