











update f_shortforest forest
set forest.forestquantity = (select (decode(sum(detail.quantity),
null,
0,
sum(detail.quantity)) * 0.6 +
decode(forest.forestquantity,
null,
0,
forest.forestquantity) * 0.4)
FROM d_salerplan@tpo master,
d_salerplandetail@tpo detail
where master.sorderid = detail.sorderid
and forest.estimateyear =
substr(master.ordermonth, 1, 4)
and forest.month =
substr(master.ordermonth, 5, 2)
and forest.productid = detail.productid
group by detail.productid)
where exists(select detail.quantity
FROM d_salerplan@tpo master,
d_salerplandetail@tpo detail
where master.sorderid = detail.sorderid
and forest.estimateyear =
substr(master.ordermonth, 1, 4)
and forest.month =
substr(master.ordermonth, 5, 2)
and forest.productid = detail.productid);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。