Category Archives: Mysql

#1093 – You can’t specify target table ‘table_name’ for update in FROM clause – MySQL

Have you ever got this MySQL error? Oh! You are searching for a solution right?

For the time being assume that this is your query :

DELETE FROM table_name where coulmn_name IN (SELECT coulmn_name FROM table_name  WHERE coulmn_name =’XYZ’ );

What you can do is change the query to something like this:

DELETE FROM table_name  where coulmn_name IN (SELECT * FROM (SELECT coulmn_name FROM table_name  WHERE coulmn_name=’XYZ’) AS A);