-- TABLE A에 ITEM이 유일하다고 가정
select b.item
, DECODE(REPLACE(A.ITEM,'F'),A.ITEM, (a.qty+a.price)
,(SELECT (qty+price) FROM tableA WHERE ITEM = REPLACE(A.ITEM,'F') )
) QP_SUM
from table a, table b
where a.item = b.item
;
select b.item
, DECODE((a.qty+a.price), NULL
, (SELECT (qty+price) FROM tableA WHERE ITEM = REPLACE(A.ITEM,'F') )
, (a.qty+a.price)
) QP_SUM
from table a, table b
where a.item = b.item
;