我嘗試創建mysql事件應該刪除重複的表的行。mysql刪除子查詢不能正常工作的查詢
這是我的查詢
DELETE FROM locations
WHERE id NOT IN (SELECT id
FROM locations
GROUP BY acc_id,`date`)
我得到這個錯誤:
Error Code: 1093
You can't specify target table 'locations' for update in FROM clause.
如何更改查詢,使其工作?
重複:http://stackoverflow.com/questions/2630440/how-to-delete-duplicates-on-mysql-table – crafter