SELECT lv
, pcode_item
, ccode_item
, ea
, TRIM(BOTH ’*’ FROM ea_list) ea_list
, EXP(SUM(LN(SUBSTR(ea_list,INSTR(ea_list,’*’,1,rn)+1
,INSTR(ea_list,’*’,1,rn+1)-INSTR(ea_list,’*’,1,rn)-1)
))) ea_sum
FROM (SELECT ROWNUM sort_no
, LEVEL lv
, pcode_item
, ccode_item
, ea
, SYS_CONNECT_BY_PATH(ea,’*’)||’*’ ea_list
FROM t
START WITH pcode_item = ’A’
CONNECT BY PRIOR ccode_item = pcode_item
) a
, (SELECT ROWNUM rn
FROM dual
CONNECT BY LEVEL <= 10) b
WHERE lv >= rn
GROUP BY sort_no
, lv
, pcode_item
, ccode_item
, ea
, ea_list