0

find duplicates in a table using SQL

What would be a simple way to find duplicates in a table using SQL Select statement?

22nd Feb 2019, 4:26 AM
Bill Le
Bill Le - avatar
3 Answers
+ 2
To find duplicate records SELECT username, email, COUNT(*) FROM users GROUP BY username, email HAVING COUNT(*) > 1 To delete the duplicate records in a table use the following link https://www.sololearn.com/Discuss/274045/how-to-delete-duplicate-records-in-sql
22nd Feb 2019, 4:34 AM
Akwin Lopez
Akwin Lopez - avatar
0
thanks! i still dont understand the sql which delete the dup. Do you mind explain it further, please?
22nd Feb 2019, 5:23 AM
Bill Le
Bill Le - avatar
0
i understand now
22nd Feb 2019, 2:46 PM
Bill Le
Bill Le - avatar