From oracle-l-bounce@freelists.org Fri Dec 9 19:15:31 2005 Return-Path: Received: from air891.startdedicated.com (root@localhost) by orafaq.com (8.12.10/8.12.10) with ESMTP id jBA1FVIW017741 for ; Fri, 9 Dec 2005 19:15:31 -0600 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air891.startdedicated.com (8.12.10/8.12.10) with ESMTP id jBA1FSAX017732 for ; Fri, 9 Dec 2005 19:15:29 -0600 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5431C2501BC; Fri, 9 Dec 2005 20:15:20 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31807-08; Fri, 9 Dec 2005 20:15:20 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D14A0250139; Fri, 9 Dec 2005 20:15:19 -0500 (EST) Received: with ECARTIS (v1.0.0; list oracle-l); Fri, 09 Dec 2005 20:15:19 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 688C72501C1 for ; Fri, 9 Dec 2005 20:15:19 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31807-06 for ; Fri, 9 Dec 2005 20:15:19 -0500 (EST) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with SMTP id ECE342501BC for ; Fri, 9 Dec 2005 20:15:18 -0500 (EST) Received: (qmail 64968 invoked from network); 10 Dec 2005 01:15:18 -0000 Received: from unknown (HELO win64bit) (unknown) by unknown with SMTP; 10 Dec 2005 01:15:18 -0000 X-pair-Authenticated: 12.37.13.198 Date: Fri, 9 Dec 2005 20:15:16 -0500 From: Jonathan Gennick Message-ID: <1564753058.20051209201516@gennick.com> To: Ethan Post Cc: oracle-l@freelists.org Subject: Re: Instead of SUM() I require MULTIPLY In-Reply-To: <357b48a90512091413x3471adc5w463f25d45f2dc75d@mail.gmail.com> References: <357b48a90512091413x3471adc5w463f25d45f2dc75d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 29076 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: jonathan@gennick.com Precedence: normal Reply-To: jonathan@gennick.com X-list: oracle-l X-Virus-Scanned: by amavisd-new-20030616-p9 (Debian) at avenirtech.net X-mailscan-MailScanner-Information: Please contact the ISP for more information X-mailscan-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-MailScanner-From: oracle-l-bounce@freelists.org Hello Ethan, You can sum the logarithms, and then raise the result to the power of e using the exp function. For example, try: select exp(sum(ln(x))) from test; It should give you the results you are after. 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@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