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

对D400117一些数据修改记录

时间:2018-05-08 23:01:09      阅读:193      评论:0      收藏:0      [点我收藏+]

标签: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一些数据修改记录

标签:mssql

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

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