題解 | #刪除emp_no重復(fù)的記錄,只保留最小的id對(duì)應(yīng)的記錄。#
刪除emp_no重復(fù)的記錄,只保留最小的id對(duì)應(yīng)的記錄。
http://fangfengwang8.cn/practice/3d92551a6f6d4f1ebde272d20872cf05
MySQL is not allowed to delete record with selecting action. So the point of this problem is rebuilding a new chart for next step of deleting.
DELETE FROM titles_test WHERE id NOT IN ( SELECT * FROM( SELECT MIN(id) FROM titles_test GROUP BY emp_no ) as A )