连表更新

Posted yaoyao66123

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了连表更新相关的知识,希望对你有一定的参考价值。

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

以上是关于连表更新的主要内容,如果未能解决你的问题,请参考以下文章

SQLDML语句-SQL更新与删除:单表更新删除与连表更新删除语法

SQL 连表更新

连表更新

mysq 连表更新

Django之数据库连表操作

SQL 语句,postgres的数据库的连表查询