update MT_PL_ZSBATCHDISPLAY_VER x
set x.lastmonthsilkquantity = (select lastmonthsilkquantity
from MT_PL_ZSBATCHDISPLAY_VER y
where y.pb_pd_materialid =
x.pb_pd_materialid
and y.leafblendno = x.leafblendno
and y.mt_pl_mainplanbatchrecord_id =
'3edfc47a-0cc6-4beb-84f1-50b9d4580f62')
where x.mt_pl_mainplanbatchrecord_id =
'9df6ca40-edae-4071-85b0-7d924edcf9f0'
update MT_PL_ZSBATCHDISPLAY_VER x
set x.lastmonthbatchnunber = (select lastmonthbatchnunber
from MT_PL_ZSBATCHDISPLAY_VER y
where y.pb_pd_materialid =
x.pb_pd_materialid
and y.leafblendno = x.leafblendno
and y.mt_pl_mainplanbatchrecord_id =
'3edfc47a-0cc6-4beb-84f1-50b9d4580f62')
where x.mt_pl_mainplanbatchrecord_id =
'9df6ca40-edae-4071-85b0-7d924edcf9f0'
update MT_PL_LEAFBLENDBATCH_DEL x
set x.blendingstatus = 0
where (pb_pd_materialid, productbatchno, leafblendno) in
(select pb_pd_materialid, productbatchno, leafblendno
from MT_PL_ZSBATCHDISPLAYDETIAL_VER t1
where t1.mt_pl_mainplanbatchrecord_id in
(select t.mt_pl_mainplanbatchrecord_id
from MT_PL_MAINPLANBATCHRECORD t
where t.planmonth = to_date('2010-08-01', 'yyyy-MM-dd')))