Find duplicate rows
List values that appear more than once.
SQL · Find duplicate rowsIntermediate
SELECT email, COUNT(*) AS times
FROM users
GROUP BY email
HAVING COUNT(*) > 1
ORDER BY times DESC;mysqlcleanup
List values that appear more than once.
SELECT email, COUNT(*) AS times
FROM users
GROUP BY email
HAVING COUNT(*) > 1
ORDER BY times DESC;