In my database there is a table which consist redundant data. It means it is having the same data multiple times in multiple rows.
I want to delete all redundant data and keep only one record. The problem is my table has no primary or unique key now. But I have data in it.
Could you give me an example of a MySQL query that delete all duplicate row ?
DELETE
FROM enr_money_handover_detail
WHERE lastupdate IN (
SELECT lastupdate
FROM enr_money_handover_detail
GROUP BY lastupdate);
This shows the error like
You can't specify target table 'enr_money_handover_detail' for update in FROM clause".