1、题目描述
来源:力扣(LeetCode)
2、解题思路
其实就是统计各人的关注着数量,但是排除掉没有关注过其他人的
1# 两表联查,一个记录被谁关注(关注者)f1
,另一个记录关注了谁f2
2# 分类统计数量,记得去重count(distinct f1.followee,f1.follower) as num
3# 排除,没有关注其他人的where f2.follower is not null
3、提交记录
select f1.followee as follower ,count(distinct f1.followee,f1.follower) as num
from follow f1 left join follow f2
on f1.followee=f2.follower
where f2.follower is not null
group by f1.followee