Hi everyone,
I am trying to remove all the duplicates in a large table.
I found the post on here regarding finding duplicates which gave the following SQL query
And for my database it is
This tells which are duplicates but it only give me one row per duplicate, so if there are two items called "fish" then i only see one of the IDs.
My aim is to make this into a DELETE query so that i can clean all the duplicates in one hit.
Can someone kind give me some advice on how to modify my query to do this.
Thanks,
JEz
I am trying to remove all the duplicates in a large table.
I found the post on here regarding finding duplicates which gave the following SQL query
Code:
SELECT Domain_Name, Count(Someotherfield) AS CountOfEntry
FROM Domain
GROUP BY Domain_name
HAVING (((Count(Someotherfield))>1));
And for my database it is
Code:
SELECT item_id, item_name, COUNT(item_name) as NumNames
FROM items
GROUP BY item_name
HAVING (COUNT(item_name) > 1);
This tells which are duplicates but it only give me one row per duplicate, so if there are two items called "fish" then i only see one of the IDs.
My aim is to make this into a DELETE query so that i can clean all the duplicates in one hit.
Can someone kind give me some advice on how to modify my query to do this.
Thanks,
JEz