Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> [Q]How can I sum up the amount in hierarical data?
[Q]How can I sum up the amount in hierarical data?
There is an organization tree like this
DEPT000
- DEPT100
-DEPT110 300
-DEPT120 250
-DEPT130 120
- DEPT200
-DEPT21O 100
-DEPT220 210
- DEPT300
-DEPT310 310
-DEPT320 150
I want to sum up the cost of each department to it's parent department
like
DEPT000 1440 <---
- DEPT100 670 <---
-DEPT110 300
-DEPT120 250
-DEPT130 120
- DEPT200 310 <---
-DEPT21O 100
-DEPT220 210
- DEPT300 460 <---
-DEPT310 310
-DEPT320 150
Can I use Hierarchical query to do that? What SQL statement should I use?
Thanks for your help.
yuanfu_at_iname.com
Received on Sun Jan 18 1998 - 00:00:00 CST