Jay R
asked on
Finding duplicate records in tables
I have a table with some duplicate records in them
Can someone please suggest the best or most efficient way of quickly finding out duplicates in a table & print those records out.
Can someone please suggest the best or most efficient way of quickly finding out duplicates in a table & print those records out.
Which fields should we query to know that the record is duplicated (ID, name, ...)?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
btw I see this is your first week here, so welcome to EE.
HI Jay,
For example, If you want to check duplicate Email in one of the column in a table
SELECT email,
COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )
For example, If you want to check duplicate Email in one of the column in a table
SELECT email,
COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )