I've a problem which is annoying the hell out of me!
I have a database with several thousand users. The data originally came from a database which I cannot trust data from, so I have imported it into another 'clean-up' database to remove duplicate entries.
I performed the query:
SELECT uid, username
FROM users
GROUP BY username
HAVING COUNT(username)>1
This is a sample of my table in its present state:
uid forename surname username
1 Jo Bloggs jobloggs
2 Jo Bloggs jobloggs
3 Jane Doe janedoe
4 Jane Doe janedoe
After performing the query above, I get the following sample result:
uid forename surname username
2 Jo Bloggs jobloggs
As you can see, there are 2 duplicate users, however the query is only displaying one of these.
When I perform the query, I get 300~ results. Obviously if the query isn't pulling all the duplicates, I cant trust this result set to be accurate and can't proceed with the clean up.
Any idea's about what I can try?
Thanks
Phil