UPDATE table a,
(SELECT store_id,name FROM store) AS s
SET a.name = s.store_name WHERE s.store_id=a.id
mysql用一个表的数据更新另一个表
![](https://img-home.csdnimg.cn/images/20240711042549.png)
UPDATE table a,
(SELECT store_id,name FROM store) AS s
SET a.name = s.store_name WHERE s.store_id=a.id