#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);

 

One thought on “#1093 – You can’t specify target table ‘table_name’ for update in FROM clause – MySQL”

  1. Pingback: max

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>