I have a mysql table. The headers are structured like so:
field field field field vendors
data data data data data
data data data data data
data data data data data2
data data data data data2
data data data data data2
Now, I want remove duplicate rows of rows sharing the same vendor value. So two rows that are the same but have different vendor column value should not be considered duplicate. But, two or more rows that equal and share the same vendor value would be considered duplicates and should be removed, leaving only one existing copy.
How can this be done using mysql?
I did something like this but it deletes everything instead of just the duplicate values. I want at least one copy remaining.
DELETE
FROM auto WHERE ((auto.email='carolzvalentine@yahoo.com') AND (auto.vendors='5552'))