Jump to content

Delete duplicated rows?


karimali831

Recommended Posts

Hi all,

 

I have mistakenly inserted duplicated rows and will take forever removing them manually so hoping someone can help me with the SQL to remove duplicated results.  You can see the image where the duplicated row begins and so on.

 

The rows userID, clanID and cupID shouldn't have a duplicate. I have fixed this in my script just need to get rid of the duplicates and obviously only having 1 one of the rows.

 

duplicates.png

 

Thanks to anyone

Link to comment
https://forums.phpfreaks.com/topic/259451-delete-duplicated-rows/
Share on other sites

You'r deleting it from phpmyadmin? I think this will do it if you put it in your sql of phpmyadmin fot that table

 

DELETE FROM table_name WHERE id != 16430; if 16430 is the record you want to keep

 

OR

 

DELETE FROM table_name WHERE id != 16430 And cupID = 45; for a little insurance and if you want to get rid of only the 45's

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.