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: Instead of SUM() I require MULTIPLY

Re: Instead of SUM() I require MULTIPLY

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Fri, 9 Dec 2005 20:16:56 -0500
Message-ID: <196814777.20051209201656@gennick.com>


A caveat to my previous response. That trick works only for positive numbers. It'll fail if a zero or negative value is encountered.

Best regards,

Jonathan Gennick --- Brighten the corner where you are http://Gennick.com * 906.387.1698 * mailto:jonathan@gennick.com

Friday, December 9, 2005, 5:13:09 PM, Ethan Post (post.ethan_at_gmail.com) wrote: EP> I just came up with a function I would like, but don't think exists.

EP> TABLE TEST (X NUMBER)
EP> =====================
EP> 2
EP> 2
EP> 4

EP> select sum(x) from test;

EP> will return 8...

EP> what I need is

EP> select multiply(x) from test;

EP> will return 16, because 2*2*4 is 16.

EP> Anyone ever seen a SQL aggregate function like this? I don't think it exists EP> but I hold out hope.

EP> - Ethan

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Dec 09 2005 - 19:17:11 CST

Original text of this message

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