update table1
set isDeleted = 1
where isDeleted = 0
and mId in (select id from table1 where isDeleted = 1 );
错误代码:1093。您无法指定目标表' table1'用于FROM子句中的更新
答案 0 :(得分:2)
使用联接:
UPDATE table1 t1
JOIN table1 t2 ON t1.mId = t2.id
SET t1.isDeleted = 1
WHERE t1.isDeleted = 0
AND t2.isDeleted = 1