两表 同一字段数据相同 顺序不同,相比较对应值填入第二字段值;
对应相同的数据 根据某字段对比 字段数据一致则将另一字段数据对应填入 否则为null!
select t1.qymc,t1.bz,t2.qymc,t2.qyjj from yjs_qy_qyjbxx t1 left join y_drb t2 on t1.qymc = t2.qymc where bz;
update yjs_qy_qyjbxx t1,y_drb t2 set t1.bz=t2.qyjj where t1.qymc = t2.qymc;
select *from y_drb
select * from yjs_qy_qyjbxx where bz is null
update yjs_qy_qyjbxx set GSJJ = bz
ALTER TABLE yjs_qy_qyjbxx DROP bz