Finding duplicates/triplicates records on MYSQL

MySQL statement that will query records with more than 1 results:

Example: you will query to display the email address and total count of email address exist on the recordset

$sql = "SELECT emailaddress, COUNT(emailaddress) AS TotalCount
FROM tbl_users
GROUP BY emailaddress
HAVING ( COUNT(emailaddress) > 1 )";

Leave a Reply