Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Usando mysql COUNT para contar várias colunas

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