sql >> Database teknologi >  >> RDS >> Mysql

Brug af mysql COUNT til at tælle flere kolonner

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


  1. Forklar Planlæg Cost Pain Point

  2. hvordan man serialiserer og deserialiserer dvaleobjekt?

  3. mysql_fetch_array() forventer, at parameter 1 er ressource, streng givet

  4. Gennemgang:Opsætning af SQL Server High Availability