数据如今是这种,我想确定出type列中的news和image。。。。甚至以后有其它值,他们分别有多少个。
SELECT
type,
count(1) AS counts
FROM
material
GROUP BY
type
count(1),代表统计第一列。写上1 比写 *的 效率高!
数据如今是这种,我想确定出type列中的news和image。。。。甚至以后有其它值,他们分别有多少个。
SELECT
type,
count(1) AS counts
FROM
material
GROUP BY
type