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: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Tue, 25 Apr 2006 12:53:35 +0200
Message-ID: <e2kv13$5ej$1@news3.zwoll1.ov.home.nl>


Wolfram Roesler wrote:
> 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

Sum strings?!
SQL Server background, where concatenation is done with '+'? In Oracle it's '||' - two vertical bars
Search for concatenation, or string manipulation, on Oracle's documentation site: http://tahiti.oracle.com

-- 
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Received on Tue Apr 25 2006 - 05:53:35 CDT

Original text of this message

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