Duplicate Emails

You can find all the duplicate emails by using the GROUP BY clause along with the HAVING condition. Here’s the query to achieve this:

1
2
3
4
SELECT email AS Email
FROM Person
GROUP BY email
HAVING COUNT(email) > 1;

This query groups the results by the email column and filters to include only those groups having more than one occurrence (i.e., duplicate emails).