统计某个字段的种类的个数

SELECT
 type, 
 count(1) AS counts 
FROM
 material 
GROUP BY
 type
原文地址:https://www.cnblogs.com/anxiaoyu/p/7087396.html