先检查有没有数据
select dqlx,hqlx from cpndjx where jxnd = ‘2014‘ and ocid = ‘101‘;
如果有数据,把数据更新到CPYB的ndjxje中去
select sum(dqlx)+sum(hqlx) from cpndjx where jxnd = ‘2014‘ and = ‘101‘;
select ocid,ndjxje from cpyb where substr(ym,1,4) = 2014 and ym = 201406 order by ocid for update;
原文地址:http://www.cnblogs.com/scoracle/p/3824393.html