错误 :1093 You can’t specify target table ‘table name’ for update in FROM clause
中文意思:不能先select出同一表中的某些值,再update这个表(在同一语句中)
解决:
注:把同一个table重新包一遍,重命名
原句
update person_level_test set currentStatus=0
where id=(select max(m.id) from person_level_test)
修改后
update person_level_test set currentStatus=0
where id=(select max(m.id) from (select * from person_level_test) m)
转自http://www.cnblogs.com/lteal/archive/2013/05/06/3062709.html