SQL Fiddleサンプルデータの試行錯誤だけで、これは期待されるデータを返すクエリです:
SELECT SYS_CONNECT_BY_PATH(firmware_version, '/') path_,
firmware_version,
device_count,
dmc_id,
charging_group_id,
IMAGE_PREREQUISITE,
(SELECT SUM(device_count)
FROM DM_TEMP_SUMMING_DVC_BY_FW t2
START WITH t1.firmware_version = t2.firmware_version
and T1.dmc_id = T2.dmc_id
and T1.charging_group_id = T2.charging_group_id
CONNECT BY nocycle PRIOR firmware_version=image_prerequisite and prior dmc_id = dmc_id and prior charging_group_id = charging_group_id
) sum_device
FROM DM_TEMP_SUMMING_DVC_BY_FW t1
START WITH image_prerequisite IS NULL
CONNECT BY nocycle PRIOR firmware_version = image_prerequisite
and prior dmc_id = dmc_id
and prior charging_group_id = charging_group_id
注: はい、charging_group_id
およびdmc_id
krokodilkoが上記のコメントで正しく言及しているように、期待される結果にとって非常に重要です。