Skip to content

614. Second Degree Follower 👎

1
2
3
4
5
6
7
8
SELECT
  Follower.follower,
  COUNT(DISTINCT Followee.follower) AS num
FROM Follow AS Follower
INNER JOIN Follow AS Followee
  ON (Follower.follower = Followee.followee)
GROUP BY 1
ORDER BY 1;