MySQL #1093 - You can't specify target table 'giveaways' for update in FROM clause
问题 I tried: UPDATE giveaways SET winner = \'1\' WHERE ID = (SELECT MAX(ID) FROM giveaways) But it gives: #1093 - You can\'t specify target table \'giveaways\' for update in FROM clause This article seems relevant but I can\'t adapt it to my query. How can I get it to work? 回答1: This is because your update could be cyclical... what if updating that record causes something to happen which made the WHERE condition FALSE ? You know that isn't the case, but the engine doesn't. There also could be