Mysql中update被查询出来的记录
UPDATE table_name
AS alias_1 INNER JOIN (SELECT * FROM table_name
WHERE column
= value) AS alias_2 SET alias_1.column_1 = value WHERE alias_1.id = alias_2.id
其中inner join后面的内容可以是任何的查询语句,包括连表查询。
UPDATE table_name
AS alias_1 INNER JOIN (SELECT * FROM table_name
WHERE column
= value) AS alias_2 SET alias_1.column_1 = value WHERE alias_1.id = alias_2.id
其中inner join后面的内容可以是任何的查询语句,包括连表查询。