一、题目
现有关注表 t_follow,包含from_user:关注者,to_user:被关注者。...执行SQL
select
from_user,
to_user,
count(1)
from
(
select
from_user,...to_user
from t_follow
union all
select
to_user,
from_user
from t_follow...拼接SQL
select
from_user,
to_user,
if(from_userto_user, concat_ws('-',from_user,to_user),concat_ws...select
if(from_userto_user, concat_ws('-',from_user,to_user),concat_ws('-',to_user,from_user))