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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Re[2]: Instead of SUM() I require MULTIPLY

RE: Re[2]: Instead of SUM() I require MULTIPLY

From: Lex de Haan <lex.de.haan_at_naturaljoin.nl>
Date: Sun, 11 Dec 2005 13:11:45 +0100
Message-ID: <001701c5fe4c$0e6b4d90$6501a8c0@LAPTOPLEX>


yes, you can -- it just needs some coding efforts.  

you can return the product (result of multiplication) of a set of numbers, you can return the concatenation of a set of strings, you can return *anything* that makes sense, based on the following assumptions:  

so just use your fantasy, and then your coding skills :-) see the documentation I mentioned earlier.  

note that it is sometimes non-trivial to handle all the borderline cases (like NULLs and empty sets) and to handle all exceptions/error situations properly -- but it can be done.  

As you can see, Oracle SQL is very extensible!

kind regards,

Lex.



Jonathan Lewis Seminar <http://www.naturaljoin.nl/events/seminars.html> http://www.naturaljoin.nl/events/seminars.html

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Yongping Yao
Sent: Sunday, December 11, 2005 12:17
To: Oracle-L Freelists
Subject: Re: Re[2]: Instead of SUM() I require MULTIPLY

Thanks all,
It's a very helpful solution. Have someone considered some similar occassion when we have to concat values?
For example,
1 a
1 b
3 c
4 a
1 e
then we want the resultset as
1 a,b,e
3 c
4 a

I have a solution in PL/SQL. Can a simple SQL solve it? Just curious :)

On 12/11/05, Ethan Post < post.ethan_at_gmail.com <mailto:post.ethan_at_gmail.com> > wrote:

Wow, great information everyone! Thanks for the more than helpful responses.


--
http://www.freelists.org/webpage/oracle-l
Received on Sun Dec 11 2005 - 06:11:49 CST

Original text of this message

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