Home >Database >Mysql Tutorial >mysql通过关联修改表中两个字段的值_MySQL

mysql通过关联修改表中两个字段的值_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:35:151689browse

bitsCN.com


mysql通过关联修改表中两个字段的值

 

Sql代码

 

update  A set a_field= 

 

(select realname from B where A.extension=B.extension  and  B.extension '')    

  

update A a  inner join B b on a.extension=b.extension and a.extension '' 

 

set a.extenrealname =b.realname

 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn