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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL question: GROUP BY: Is there a "SUM" for strings?

Re: SQL question: GROUP BY: Is there a "SUM" for strings?

From: Maxim Demenko <mdemenko_at_arcor.de>
Date: Tue, 25 Apr 2006 12:32:06 +0200
Message-ID: <444dfbb0$0$11073$9b4e6d93@newsread4.arcor-online.net>


Wolfram Roesler schrieb:
> Hello,
>
> is there something like SUM, but for strings?
>
> I can do
>
> SELECT SUM(colname)
> FROM mytable
> WHERE whatever
> GROUP BY whatever;
>
> to sum up numbers of a group, but how would I do this if
> colname was a VARCHAR2 (doing string concatenation instead
> of addition)?
>
> I'm still on Oracle 8.1.6.3.
>
> Thanks for your help
> W. Roesler

Tim Hall has pretty summary of different approaches with further links to this thema , pick a suitable for your version. http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php

Best regards

Maxim Received on Tue Apr 25 2006 - 05:32:06 CDT

Original text of this message

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