Delete double rows in mysql database
Posted on 2014-01-28
I have a table (table1) with 3 columns, id, text, flag.
The table contains tens of thousands of rows with some text.
Some of these rows are doubles.
I tried this query below to delete these double entries, but it runs for hours and deletes nothing.
DELETE n1 FROM table1 n1, table1 n2 WHERE n1.id > n2.id AND n1.text = n2.text
Does anybody have a better (working) and faster query?