要理解group by之后的count的用法,count()里的是另外一列,所以count(distinct follower),记得加distinct,同一个关注者是不能被重复记的。
select followee follower,count(distinct follower) num
from follow
where followee in (select distinct follower from follow)
group by followee
要理解group by之后的count的用法,count()里的是另外一列,所以count(distinct follower),记得加distinct,同一个关注者是不能被重复记的。
select followee follower,count(distinct follower) num
from follow
where followee in (select distinct follower from follow)
group by followee