Error as follows:
错误代码: 1093
You can't specify target table 'student_info' for update in FROM clause
Means: time for modifications to the table can not modify this table as a condition.
Solution: between the table and modify look-up table plus a layer query.
E.g:
/*错误SQL*/
DELETE FROM student_info WHERE id IN(
SELECT id FROM `student_info`)
/*正确SQL*/
DELETE FROM student_info WHERE id IN(
SELECT a.id FROM
(SELECT id FROM `student_info`)a
)
Tip: The error is common in data deduplication operation, specifically refer to this blog ( related operations MySQL duplicated data (the case containing the primary key table does not exist) ).