MySQL查询某个列中相同值的数量统计

select `type`,count(1) as counts from `api_count` group by `type`
(order by counts DESC)
select
  `type`, //查询某个列
  count(1) as counts //相同值的数量统计到(as)某列中
from
  `api_count` //来自某个表
group by
  `type` //根据(by)一定的规则进行分组(Group)

 

posted @ 2021-01-18 16:42  景北斗  阅读(2154)  评论(0编辑  收藏  举报