Duplicate Emails

  • Problem
    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 should return the following for the above table:
    +---------+
    | Email |
    +---------+
    | a@b.com |
    +---------+
    Note: All emails are in lowercase.

  • Code

Write your MySQL query statement below

select Email from Person group by Email having count(*) > 1

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容