Using Join, Count and Distinct


  • 0

    SELECT
    wee.follower,
    count(Distinct wer.follower) AS num
    FROM
    follow AS wer
    JOIN
    follow AS wee
    ON
    wee.follower = wer.followee
    GROUP BY wer.followee
    ORDER BY wee.follower


Log in to reply
 

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