Home > Database > Mysql Tutorial > mysql-sql 根据条件update数据

mysql-sql 根据条件update数据

WBOY
Release: 2016-06-06 09:37:56
Original
1338 people have browsed it

mysqloraclesql

有两个表分别为tb_child(child_id,name),tb_cdc_child(child_id,username)tb_child的数据为(t1,jack)(t2,mary)两条,tb_cdc_child的数据为(t1,lee)(t2,tom)两条。现需做update操作,将tb_child中child_id与tb_cdc_child中child_id相同的那条数据的name字段更新为tb_cdc_child中对应数据的username字段。即更新过后的tb_child的数据变为(t1,lee)(t2,tom)能否用一句sql实现该功能

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