1、用join的方式,在mysql中行不通:
SELECT b.remarks,b.DictSortCode,c.* from scm_dict_config c left join scm_dict_base b on c.DictSortCodeScm=b.remarks update scm_dict_config set c.DictSortCode=b.DictSortCode from scm_dict_config c left join scm_dict_base b on c.DictSortCodeScm=b.remarks where (b.DictSortCode!='' and b.DictSortCode is not null) update scm_dict_config c,scm_dict_base b set c.DictSortCode=b.DictSortCode where c.DictSortCodeScm=b.remarks and (b.DictSortCode!='' and b.DictSortCode is not null) SELECT b.remarks,b.DictSortCode,c.DictSortCode from scm_dict_config c left join scm_dict_base b on c.DictSortCodeScm=b.remarks where (b.DictSortCode!='' and b.DictSortCode is not null)
SELECT * from org_bm_tmp
-- 修改org编码
update scm_org c,org_bm_tmp b set c.org_bm=b.org_bm where c.orgName=b.org_name