timster - 11:28 pm on Mar 5, 2011 (gmt 0)
Welcome to webmasterworld.
You can find the similar rows inside the same table with a self join. But I don’t think you will be able to delete the rows from the same table in the same query.
The solution is to create a duplicate table to select from. Then select the data from the duplicate table, and then to delete the data in the first table.
Here is example code. Please test it, and when you are sure it does what you want, replace the “select *” with “delete”. Of course, you’ll have to replace the names of the tables as well.
where id in (
from test_copy t1
test_copy t2 on
t1.value = t2.value
where t1.cid = 1
and t2.cid = 3