1.插入月实际值2.更新年实际值
update table set 年实际值=(select sum(月实际值) from table where 年=?  指标编号=?)
where  年=? and 指标编号=? and 月=?

解决方案 »

  1.   

    没有必要这么做, 完全可以不作这种操作.创建一个物化视图,更新机制为refresh on commit;
    或者直接创建一个视图去做这种统计工作.
      

  2.   

    create or replace procedure aa(id in number,month number,year in number)
    as
    begin
    insert into table(..)
    values(..);
    commit;
    update table a set 年实际值=(select sum(月实际值) from table where b.year=year)
    where a.year=year;
    end aa;