I am trying to remove duplicate rows from my database so for that I am using this query
DELETE FROM data
WHERE data.ID NOT IN (
SELECT * FROM (
SELECT MIN(ID) FROM data GROUP BY Link
) AS p
)
It is working fine but the problem is my database has over 1 Million rows so when I use this it takes the hell of time like after 4 to 5 hours it was still at loading.. and then I just closed the tab. So Please if someone has a better query tell me. Thanks in Advace
Table Structure http://s29.postimg.org/bt57k5enb/image.jpg