其他分享
首页 > 其他分享> > 连表更新

连表更新

作者:互联网

update tb_city t2 join (

select a2,count(1),group_concat(a4) as a4,group_concat(a5) as a5 from weidu where a3 is null GROUP BY a2 HAVING count(1) = 1

) t1 on t1.a2 = t2.city_name set t2.lng = a4,t2.lat = a5

 

select * from (

select a2,count(1),group_concat(a4) as a4,group_concat(a5) as a5 from weidu where a3 is null GROUP BY a2 HAVING count(1) = 1

) t1 join tb_city t2 on t1.a2 = t2.city_name

标签:city,group,t2,更新,连表,a2,a5,a4
来源: https://www.cnblogs.com/yaoyao66123/p/13333881.html