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: concatenate the same column with mulitple rows

Re: concatenate the same column with mulitple rows

From: William Robertson <williamr2019_at_googlemail.com>
Date: Sun, 2 Dec 2007 02:37:55 -0800 (PST)
Message-ID: <6a15ed7f-e7a4-4fbd-9f43-9c45d4d25b59@b15g2000hsa.googlegroups.com>


On Dec 1, 4:33 am, sheridany <sherid..._at_yahoo.com> wrote:
> I have an oracle database that has text values (comments) in
> subsequent rows and I need to add them all together by the primary
> key.
>
> primary key text_field
> 1111 I like Oracle
> 1111 It is fast
> 1111 Their support is great!
> 2222 Oracle is hard
>
> The data would look like this in the result set. We cannot create
> tables on this db so we only have read access.
>
> 1111 I like Oracle It is fast Their support is great!
> 2222 Oracle is hard

In 10g you can use the (apparently undocumented) aggregate function wm_concat (part of the wmsys schema used for Workspace Management, but there is a public synonym). I think it's Tom Kyte's "stragg" internally. It uses a comma as the separator though. Received on Sun Dec 02 2007 - 04:37:55 CST

Original text of this message

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