Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> SQL recursive multiply
Hi,
Let s assume, I have the following table :
PID ID QTE
--- -- ---
10 20 3
20 31 2
20 32 3
10 21 2
21 33 5
10 23 1
The first question is : how to multiply the QTE column, the same way I can do a simple sum(QTE), to get : 3*2*3*2*5*1=180
The second question is : if I consider the following three build with a "start with/connect by" function where PID=parent Identifier and ID=Identifier, how can I recursivly multiply the quantities (QTE) to get the quantity I need for each lowest level :
10
20
31 (3*2=6)
32 (3*3=9)
21
33 (2*5=10)
23 (1=1)
Regards, Remy James.
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Jan 29 1999 - 07:37:48 CST
![]() |
![]() |