こんな感じでしょうか。 select a1.*, case when 項目1 is null then 項目数量 else (select sum(項目数量) from TB_A a2 where a2.項目1=a1.項目1) end as RESULT from TB_A a1;
管理者用
- Child Tree -