码迷,mamicode.com
首页 > 其他好文 > 详细

SPH00000562发现结转数量少了90

时间:2019-01-02 19:03:29      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:rsh   from   upd   rom   and   更新   数据   group by   spl   

--查自身结转数量是否不正确
select shqjzhshl,cwjcsl+cksl-bqrsh,bqrsh-cksl, from ymjzhk where spid=‘SPH00000562‘ order by jzhh desc
--检查结转库与流水库结转数据是否一致
select jzhh,sum(rkshl),sum(chkshl),sum(rkshl)-sum(chkshl) From splsk where spid=‘SPH00000562‘ group by jzhh order by jzhh desc
--对比发现JZH00000040结转库cksl多出了90
--备份要更新数据
select
into fr_ymjzhk20190102_SPH00000562 from ymjzhk where spid=‘SPH00000562‘ and nian=‘2018‘ order by jzhh desc
--更新数据
update ymjzhk set cksl=1616-90,bqxsshl=1616-90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid=‘SPH00000562‘ and jzhh=‘JZH00000040‘
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid=‘SPH00000562‘ and jzhh=‘JZH00000041‘
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid=‘SPH00000562‘ and jzhh=‘JZH00000042‘
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid=‘SPH00000562‘ and jzhh=‘JZH00000043‘
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid=‘SPH00000562‘ and jzhh=‘JZH00000044‘
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid=‘SPH00000562‘ and jzhh=‘JZH00000045‘
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid=‘SPH00000562‘ and jzhh=‘JZH00000046‘
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid=‘SPH00000562‘ and jzhh=‘JZH00000047‘
--更新结转数量(容易遗忘)
update spkfjc set shqjzhshl=230+90 where spid=‘SPH00000562‘
update hwsp set jzshl=230+90 where spid=‘SPH00000562‘ and hw=‘HWI00000025‘
--检查所有结转数量是否正确
select * from spkfjc where cwsqjzsl<>kcshl

SPH00000562发现结转数量少了90

标签:rsh   from   upd   rom   and   更新   数据   group by   spl   

原文地址:http://blog.51cto.com/bks2015/2337950

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!