1. 程式人生 > >對D400117一些數據修改記錄

對D400117一些數據修改記錄

mssql

update pf_ckmx set rq=‘2018-01-14‘ where djbh=‘XSCYMA00029873‘
update pf_ckhz set rq=‘2018-01-14‘ where djbh=‘XSCYMA00029873‘
update cwk set rq=‘2018-01-14‘ where djbh=‘XSCYMA00029873‘
update spls_ck set rq=‘2018-01-14‘ where djbh=‘XSCYMA00029873‘
update mxysyf set rq=‘2018-01-14‘ where djbh=‘XSCYMA00029873‘
update wlzhk set rq=‘2018-01-14‘ where djbh=‘XSCYMA00029873‘
--只對部分數據進行修改沒有修改毛利和成本
update a set a.chkshl=b.chkshl,a.pihao=b.pihao,a.xshe=b.xshe,a.xshje=b.xshje from spls_ck a,fr_splsk_ckgjb20180508xg b where a.djbh=b.djbh and a.spid=b.spid
update a set a.shl=b.shl,a.dj=b.dj,a.hshj=b.hshj,a.lingsshl=b.lingsshl,a.pihao=b.pihao,a.sxrq=b.sxrq,a.baozhiqi=b.baozhiqi,a.hsje=b.hsje,a.je=b.je,a.she=b.she from pf_ckmx a,fr_pf_ckmxgjb20180508xg b where a.djbh=b.djbh and a.spid=b.spid

select djbh,sum(je) je,sum(she) she,sum(hsje) hsje into #2 from pf_ckmx where djbh in (select djbh from fr_pf_ckmxgjb20180508xg) group by djbh
update a set a.she=b.she,a.hsje=b.hsje,a.je=b.je from fr_pf_ckhzgjb20180508xg a,#2 b where a.djbh=b.djbh

update a set a.hsje=b.hsje,a.je=b.je,a.she=b.she from pf_ckhz a,fr_pf_ckhzgjb20180508xg b where a.djbh=b.djbh

--還原
update a set a.chkshl=b.chkshl,a.pihao=b.pihao,a.xshe=b.xshe,a.xshje=b.xshje from spls_ck a,fr_splsk_ckgjb20180508 b where a.djbh=b.djbh and a.spid=b.spid
update a set a.shl=b.shl,a.pihao=b.pihao,a.sxrq=b.sxrq,a.baozhiqi=b.baozhiqi,a.hsje=b.hsje,a.je=b.je,a.she=b.she from pf_ckmx a,fr_pf_ckmxgjb20180508 b where a.djbh=b.djbh and a.spid=b.spid

update a set a.hsje=b.hsje,a.je=b.je,a.she=b.she from pf_ckhz a,fr_pf_ckhzgjb20180508 b where a.djbh=b.djbh

對D400117一些數據修改記錄