在某些时候,我们需要在MySQL中查询某个字段属性值重复的次数:

 

     select category , count(*) AS count from publication_has_category

     group by category order by count DESC limit 20

    此查询语句返回的是publication_has_category 表中category字段属性值重复次数(count)最多的前5个记录

Comments are closed.

Post Navigation