Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Concatenating multiple rows?

Re: Concatenating multiple rows?

From: Greg Forestieri <gforestieri9_at_yahoo.com>
Date: 25 Jun 2003 06:14:40 -0700
Message-ID: <6a8cdd95.0306250514.63c38f2e@posting.google.com>


laredotornado_at_zipmail.com (D. Alvarado) wrote in message news:<9fe1f2ad.0306241220.530cadf7_at_posting.google.com>...
> Hi,
> Is it possible to concatenate multiple rows of data in a single
> select statement. For example, if my table was
>
> FIELD1
> ------
> aaa
> bbb
> ccc
>
> is there a way in Oracle to have a single select statement that could
> produce
>
> 'aaa,bbb,ccc'?
>
>
> Thanks - Dave

select a.field1 || ',' || b.field1 || ',' || c.field1 into abcfield
from table1 a,

       table1 b,
       table1 c
where  a.field1 = 'aaa'

and b.field1 = 'bbb'
and c.field1 = 'ccc'

Sorry - I know this is probably not what was meant ;)

Greg Received on Wed Jun 25 2003 - 08:14:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US