Find duplicate rows

List values that appear more than once, with their count.

sql beginner #data-quality#group-by
פתיחה במגרש המשחקים
sql-find-duplicates.sql
SELECT lower(email) AS email, COUNT(*) AS copies
FROM users
GROUP BY lower(email)
HAVING COUNT(*) > 1
ORDER BY copies DESC;