我想更新最后生成的行(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