溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

SPH00000562發(fā)現(xiàn)結(jié)轉(zhuǎn)數(shù)量少了90

發(fā)布時(shí)間:2020-04-09 06:33:24 來(lái)源:網(wǎng)絡(luò) 閱讀:289 作者:qvodnet 欄目:關(guān)系型數(shù)據(jù)庫(kù)

--查自身結(jié)轉(zhuǎn)數(shù)量是否不正確
select shqjzhshl,cwjcsl+cksl-bqrsh,bqrsh-cksl, from ymjzhk where spid='SPH00000562' order by jzhh desc
--檢查結(jié)轉(zhuǎn)庫(kù)與流水庫(kù)結(jié)轉(zhuǎn)數(shù)據(jù)是否一致
select jzhh,sum(rkshl),sum(chkshl),sum(rkshl)-sum(chkshl) From splsk where spid='SPH00000562' group by jzhh order by jzhh desc
--對(duì)比發(fā)現(xiàn)JZH00000040結(jié)轉(zhuǎn)庫(kù)cksl多出了90
--備份要更新數(shù)據(jù)
select
into fr_ymjzhk20190102_SPH00000562 from ymjzhk where spid='SPH00000562' and nian='2018' order by jzhh desc
--更新數(shù)據(jù)
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'
--更新結(jié)轉(zhuǎn)數(shù)量(容易遺忘)
update spkfjc set shqjzhshl=230+90 where spid='SPH00000562'
update hwsp set jzshl=230+90 where spid='SPH00000562' and hw='HWI00000025'
--檢查所有結(jié)轉(zhuǎn)數(shù)量是否正確
select * from spkfjc where cwsqjzsl<>kcshl

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI