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

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

WBOY
Release: 2016-06-01 13:35:15
Original
1658 people have browsed it

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
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template