I have some rows in a MySQL database which are duplicates, except for their ID number.
For example, I might have this as two rows:
ID | wordlist | category
845 | abashed | confused
1800 | abashed | confused
I want to find all of them, and only leave one.
Can I use SQL to do this, or do I need to write a program of some sort?
To clarify, I only want to get duplicates in the wordlist section.
You can do this with an outer join in the
DELETEstatement:This will eliminate duplicates (in the
wordlistcolumn) for only a specific category and keeps the one with the lowestid.