Sharing my solution


  • 0
    M
    select Email from
    (select Email, count(*) as count from person
    group by email
    having count > 1) as emailcount;

  • 3
    K

    My first accepted like yours.

    But this is much simple. Selecting from Person directly, rather a view.

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

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.