# 优化写法
UPDATE a INNER JOIN b ON a.id = b.id
SET a.xx = b.xxx,
a.yy = b.xxx;
#示例
mysql> UPDATE data_import INNER JOIN customers ON data_import.futures_number = customers.futures_number SET data_import.developers = customers.developers,data_import.service_personal = customers.service_personal,data_import.status = 1;
Query OK, 54 rows affected
Rows matched: 54 Changed: 54 Warnings: 0
网友评论