Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: concatenate the same column with mulitple rows
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
![]() |
![]() |