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

连表更新

时间:2020-07-18 00:53:07      阅读:89      评论:0      收藏:0      [点我收藏+]

标签:date   rom   bsp   sel   where   from   更新   set   eid   

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

连表更新

标签:date   rom   bsp   sel   where   from   更新   set   eid   

原文地址:https://www.cnblogs.com/yaoyao66123/p/13333881.html

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