mysql update select (使用select)--mysql学习日志(1)

INNER JOIN

mysql不同于别的数据库语言。无法直接使用update select from

需要使用INNER JOIN

INNER JOIN(内连接,或等值连接):取得两个表中存在连接匹配关系的记录。

下面是update select的sql语句

update A inner join(select id,name from B) c on A.id = c.id set A.name = c.name;

猜你喜欢

转载自blog.csdn.net/zhanxingdong/article/details/81178099