Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting duplicated records

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
CA
Hi All,

in one of my dbs, a table has managed to duplicate itself, creating 2 entries for each row. this is including the primary key.

how can i remove the one offending row to achieve one unique row for each record?

i could not find anything in the mysql.com site about removing duplicated rows...

TIA



Bastien

cat, the other other white meat
 
Hi Bastien,

You could try using a DELETE FROM ? WHERE (SELECT DISTINCT ...) ; query.

But one thing's for sure you DB is really b0rken, there is NO WAY that the PK should be duplicated. You really need to get to the bottom of this.


William
Software Engineer
ICQ No. 56047340
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top