I got error “The DELETE statement conflicted with the REFERENCE constraint”

The error means that you have data in other tables that references the data you are trying to delete. You would need to either drop and recreate the constraints or delete the data that the Foreign Key references. Suppose you have the following tables Suppose a Foreign Key constraint exists between the StudentTypeId column in StudentTypes and the StudentTypeId column in Students … Read more

MySQL Error 1093 – Can’t specify target table for update in FROM clause

Update: This answer covers the general error classification. For a more specific answer about how to best handle the OP’s exact query, please see other answers to this question In MySQL, you can’t modify the same table which you use in the SELECT part.This behaviour is documented at: http://dev.mysql.com/doc/refman/5.6/en/update.html Maybe you can just join the table … Read more

MySQL Error 1093 – Can’t specify target table for update in FROM clause

Update: This answer covers the general error classification. For a more specific answer about how to best handle the OP’s exact query, please see other answers to this question In MySQL, you can’t modify the same table which you use in the SELECT part.This behaviour is documented at: http://dev.mysql.com/doc/refman/5.6/en/update.html Maybe you can just join the table … Read more