CREATE OR REPLACE PROCEDURE pubres_test
as
BEGIN
for obj in (
select resource_name,unit_name,resource_code,sum(update_count) update_count
from winf_pubres_update_log
group by resource_name,unit_name,resource_code)
loop
--统计汇总
insert into WINF_PUBRES_allUPDATE_LOG (unit_name,resource_name,resource_code,update_count,update_date )
values(obj.unit_name,obj.resource_name,obj.resource_code,to_char(obj.update_count),sysdate);
end loop;
END pubres_test;
原文地址:http://7883830.blog.51cto.com/7873830/1679712