Re: [SQL] Concat field result in select query

2008-08-22 Thread Lennin Caro
> 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

Re: [SQL] Concat field result in select query

2008-08-22 Thread Julien Cigar
of course: http://rafb.net/p/EOaYfO59.html Julien On Fri, 2008-08-22 at 15:58 +0200, Nacef LABIDI wrote: > any explanations ? > > On Fri, Aug 22, 2008 at 6:07 PM, Julien Cigar <[EMAIL PROTECTED]> > wrote: > array_accum ? > > > On Fri, 2008-08-22 at 15:40 +0200,

Re: [SQL] Concat field result in select query

2008-08-22 Thread Julien Cigar
Also, the array_accum aggregate isn't present by default, you need to create it with : CREATE AGGREGATE array_accum (anyelement) ( sfunc = array_append, stype = anyarray, initcond = '{}' ); On Fri, 2008-08-22 at 18:24 +0200, Julien Cigar wrote: > of course: http://rafb.net/p/EOaYfO59.

Re: [SQL] Concat field result in select query

2008-08-22 Thread Nacef LABIDI
Thank you, this is all what I need On Fri, Aug 22, 2008 at 4:10 PM, Guillaume Lelarge <[EMAIL PROTECTED]>wrote: > Nacef LABIDI a écrit : > > 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 : >

Re: [SQL] Concat field result in select query

2008-08-22 Thread Guillaume Lelarge
Nacef LABIDI a écrit : > 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 resul

Re: [SQL] Concat field result in select query

2008-08-22 Thread Julien Cigar
array_accum ? On Fri, 2008-08-22 at 15:40 +0200, Nacef LABIDI wrote: > 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

Re: [SQL] Concat field result in select query

2008-08-22 Thread Nacef LABIDI
any explanations ? On Fri, Aug 22, 2008 at 6:07 PM, Julien Cigar <[EMAIL PROTECTED]> wrote: > array_accum ? > > On Fri, 2008-08-22 at 15:40 +0200, Nacef LABIDI wrote: > > 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 sing

[SQL] Concat field result in select query

2008-08-22 Thread Nacef LABIDI
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