Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> multiply column values within a partition
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