Duplicate Emails, duplicateemails
Write a SQL query to find all duplicate emails in a table named Person. + ---- + --------- + | Id | Email | + ---- + --------- + | 1 | a@ B .com | 2 | c@d.com | 3 | a@ B .com | + ---- + --------- + For example, your query shocould return the following for the above table: + --------- + | Email | + --------- + | a@ B .com | + --------- + Note: All emails are in lowercase. mainly group by applications select Email from (select Email, co Unt (Email) as cnt from Person group by Email) t where cnt> 1; or select Email from (select Email, count (Email) as cnt from Person group by Email having cnt> 1) t; order by must be used after group by and cannot be used before group. Select Email from (select Email, count (Email) as cnt from Person order by Email group by Email) t where cnt> 1; this execution may be faulty.