Mysql
 sql >> Base de données >  >> RDS >> Mysql

Utiliser mysql COUNT pour compter plusieurs colonnes

select name_of_follower, 
       count(name_of_follower) 
  from ( select name as name_of_follower 
          from abc 
         union all 
        select follower as name_of_follower  
          from abc
       ) t
 group by t.name_of_follower 
 order by count(name_of_follower) desc