表1:
ID Total1 Total2 Total3
1 10 0 20
1 40 0 50
1 15 0 5
表 2:
ID Total
1 140
すべての行を累積的に追加し、table2 で一致する合計を見つけるにはどうすればよいですか?
すべての行を累積的に追加し、table2 で一致しない合計を見つけ、update ステートメントを記述して更新 (追加) し、table2 に書き込むにはどうすればよいですか?
select sum(t1.total1) + sum(t1.total2) +sum(t1.total3) as "Total" from
table t1, table t2 where t1.ID=t2.ID and sum(t1.total1) +
sum(t1.total2) +sum(t1.total3)=t2.total;
更新構文を正しく取得できません。