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

Home -> Community -> Usenet -> c.d.o.misc -> multiply column values within a partition

multiply column values within a partition

From: Ora <webuser007_at_gmail.com>
Date: 3 May 2005 10:55:20 -0700
Message-ID: <1115142920.081794.299930@f14g2000cwb.googlegroups.com>


Hello,

Is there a PRODUCT() OVER() equivalent to SUM() OVER() analytical function which can help me with the query output below?

In Oracle 9.2.x, given the following source data, how could I get the output shown, using SQL (no plsql).

Source Data:
c1 c2 c3


abc     jan       10
abc     feb       20
abc     mar       30
def     jan      -40
def     feb        0
def     mar      -50

Desired Output (with new c4 calculated column):
c1      c2        c3     c4

-----------------------------------------------
abc jan 10 200 -- 10*20 abc feb 20 600 -- 20*30 abc mar 30 -1200 -- 30*-40 def jan -40 2000 -- -40*-50 def feb -50 0 -- -50*0 def mar 0 0

Thanks. Received on Tue May 03 2005 - 12:55:20 CDT

Original text of this message

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