When I type this query in MySQL :
DELETE FROM myTable WHERE ID = ( SELECT Min( ID ) FROM myTable )
I get the following error message :
#1093 - You can't specify target table 'myTable' for update in FROM clause
What is the problem ?
What is the right equivalent ?
Basically in MySQL you can’t do an update on a table which you use in the
SELECTpart. For detail you could check this behaviour which is documented at: http://dev.mysql.com/doc/refman/5.6/en/update.htmlIn theory every
DELETEis anUPDATEso that’s why you get this error.You could simply do following: