Reputation: 201
I have a table that unfortunately has many duplicates. Here is a small example:
Name | Location
Mike | New Jersey
Mike | Ohio
Brian | Ohio
Mike | New Jersey
How can I only remove dups on the Mike | New Jersey lines? I'm having trouble making sure all fields match and not just Name. So my end result would be:
Name | Location
Mike | New Jersey
Mike | Ohio
Brian | Ohio
Upvotes: 0
Views: 3313
Reputation: 3827
Easier to do that in two steps:
To create a Query that will remove duplicates, use Group By. E.g.
SELECT Name,Location
FROM TABLE_NAME
GROUP BY Name,Location
Upvotes: 4