Re: Concat field result in select query - Mailing list pgsql-sql

From Lennin Caro
Subject Re: Concat field result in select query
Date
Msg-id 613677.80516.qm@web59503.mail.ac4.yahoo.com
Whole thread Raw
In response to Concat field result in select query  ("Nacef LABIDI" <nacef.l@gmail.com>)
List pgsql-sql
> Hi all,
> 
> I was wondering if there is a way to concatenate the
> results of a field in a
> select to return it as a single string.
> 
> Example :
> 
> my_field
> --------------
> 1
> 2
> 3
> 
> select concat_something(my_field) from my_table group by
> something;
> the result expected would be someting like that : 1/2/3
> (with a separator it
> would be really nice)
> 
> I hope that I am not asking for too much ;)
> 
> Thanks to all

you can use aggregate function, check for previous threads for this solution

http://www.postgresql.org/docs/8.3/static/sql-createaggregate.html

     



pgsql-sql by date:

Previous
From: Julien Cigar
Date:
Subject: Re: Concat field result in select query
Next
From: Allan Kamau
Date:
Subject: Re: Re: Efficiently determining the number of bits set in the contents of, a VARBIT field