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

20180304数据修正记录

时间:2018-03-09 11:52:40      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:数据修正

--对采购为1的明细屏蔽
update jh_rkmx set spid=replace(spid,‘SPH‘,‘SPA‘) where spid in (select spid from spkfk where spmch like ‘%胶体果胶铋胶囊%‘) and hshj=1
update pf_ckmx set spid=replace(spid,‘SPH‘,‘SPA‘) where pici in (select pici from fr_jh_rkmx20180304 where spid in (select spid from spkfk where spmch like ‘%胶体果胶铋胶囊%‘) and hshj=1)
update b set b.spid=replace(b.spid,‘SPH‘,‘SPA‘) from fr_jh_rkmx20180304 a,spls_rk b where a.djbh=b.djbh and a.dj_sn=b.dj_sn
update b set b.spid=replace(b.spid,‘SPH‘,‘SPA‘) from fr_pf_ckmx20180304 a,spls_ck b where a.djbh=b.djbh and a.dj_sn=b.dj_sn
--对两条重复记录屏蔽
update jh_rkmx set spid=replace(spid,‘SPH‘,‘SPA‘) where djbh in (‘JHCYMA00005703‘,‘JHAYMA00037099‘)
update spls_rk set spid=replace(spid,‘SPH‘,‘SPA‘) where djbh in (‘JHCYMA00005703‘,‘JHAYMA00037099‘)

update jh_rkhz set djbh=replace(djbh,‘JHAY‘,‘JHYA‘) where djbh in (‘JHCYMA00005703‘,‘JHAYMA00037099‘)
update jh_rkhz set djbh=replace(djbh,‘JHCY‘,‘JHYC‘) where djbh in (‘JHCYMA00005703‘,‘JHAYMA00037099‘)

--对调拨数据屏蔽
update spls_rk set spid=replace(spid,‘SPH‘,‘SPA‘) where djbh in (‘CDBYMA00056070‘)
update spls_ck set spid=replace(spid,‘SPH‘,‘SPA‘) where djbh in (‘CDBYMA00056070‘)

--一键恢复所有数据
update spls_rk set spid=replace(spid,‘SPA‘,‘SPH‘) where spid not like ‘sph%‘
update spls_ck set spid=replace(spid,‘SPA‘,‘SPH‘) where spid not like ‘sph%‘
update jh_rkmx set spid=replace(spid,‘SPA‘,‘SPH‘) where spid not like ‘sph%‘
update pf_ckmx set spid=replace(spid,‘SPA‘,‘SPH‘) where spid not like ‘sph%‘
update jh_rkhz set djbh=replace(djbh,‘JHYA‘,‘JHAY‘) where djbh in (‘JHCYMA00005703‘,‘JHYAMA00037099‘)
update jh_rkhz set djbh=replace(djbh,‘JHYC‘,‘JHCY‘) where djbh in (‘JHYCMA00005703‘,‘JHAYMA00037099‘)

20180304数据修正记录

标签:数据修正

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

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