我想更新最後生成的行(max(id)
排「其中」子句的表MySQL的:更新具有與最大值
我想這個代碼,但它不工作
update person t1
set t1.age = 25
where t1.id = (select max(t2.id) from person t2
where t2.address = 'LA, California');
。
MySQL的告訴我說:Error Code: 1093. You can't specify target table 't1' for update in FROM clause
所以,我想,我不能在執行操作如更新達到同樣的故事
如何℃。我唯一的這個問題?
問候。
您推薦只是簡化我查詢了這麼多的限制1方法。非常好的主意。 – 2014-02-21 19:45:15