W
WilliamGui
Unregistered / Unconfirmed
GUEST, unregistred user!
update t_material_pbstocks pb set (CURINITMONEYAVERAGE)=( select nvl(t.CURENDMONEYAVERAGE,0) from t_material_pbstocks t where t.periodofbursar = '200812' and t.storehouseguid=pb.storehouseguid) where pb.periodofbursar = '200901'update t_material_pbstocks pb set (CURINITMONEYAVERAGE)=nvl(( select t.CURENDMONEYAVERAGE from t_material_pbstocks t where t.periodofbursar = '200812' and t.storehouseguid=pb.storehouseguid),0) where pb.periodofbursar = '200901'现在值等于 200812 的比 等于 200901 的区配记录少, nvl用的地方不同方法一没有区配的记录没有记录为0, 方法二得到正确结果,但为什么?以及当多个字段时应该怎么写?