Find Duplicate Email Records in Customers

Find duplicate records and return the number of occurrences.

sql

SELECT email, COUNT(*) AS occurrences FROM customers GROUP BY email HAVING COUNT(*) > 1;

This query groups the records in the "customers" table by the "email" column and returns the count of occurrences for any email address that appears more than once.

PromptDB can make mistakes. Please double-check responses.