There’s a table that has three fields: id, word, username
And it currently has data like this:
1 | run | thisguy
2 | run | thisguy
3 | go | thatgirl
4 | go | thatguy
5 | go | thatgirl
The ones I want is 1, 3, and 4. I don’t want 2, and 5 because they’re duplicates.
How would I take them out?
Doing on the same table :
Create a unique index on the required fields/
Doing in new table :
a) Create a temporary table by selecting unique data from original table.
b) Drop original table.
c) rename temporary table to original table’s name.
Also create unique index on type,name on this table to prevent future duplicates.