here the method is a cool trick (from a scheme with different names - you have to adjust it)
select part_id, new_rec.quantity*sum(math_calc( math,2)) m, unit_of_measure from ( SELECT rownum, level lvl, part_id, quantity, unit_of_measure , connect_by_isleaf || sys_connect_by_path(quantity,'*') math from assembly start with parent_part_id = new_rec.part_id connect by parent_part_id = prior part_id ) p group by part_id, unit_of_measure
basically - this part
connect_by_isleaf || sys_connect_by_path(quantity,'*') math
makes the mathematical equation of summation as a string - then it is analyzed and calculated using this part
new_rec.quantity*sum(math_calc( math,2)) m
Randy source share