Guide 5/3/2026

How to Find Duplicate Email Addresses in SQL

#sql query find duplicate records#find duplicate emails sql#sql group by having count duplicate#clean database duplicate users sql#sql query generator for duplicates
Quick Answer
SELECT email, COUNT(email) FROM users GROUP BY email HAVING COUNT(email) > 1;

Duplicate records often creep into user databases due to registration bugs or improper data migration. This query uses the GROUP BY clause combined with the HAVING operator to filter out unique entries and return only the email addresses that appear more than once in your table.

By identifying these duplicates, you can easily flag accounts for merging or deletion. To refine this query further, you can join the results back to your primary users table to retrieve the specific user IDs associated with those redundant records.

Ready to try it?

Use our SQL Query Generator to generate perfect results in seconds.

Open SQL Query Generator