use group by and left join


  • 0
    Y
    select a.follower follower, count(distinct b.follower) num 
    from follow a left join follow b on a.follower=b.followee
    group by b.followee
    having num>=1

Log in to reply
 

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