一般我们写count语句,SQL如下:

select count(t.type) as total from table t 

如果出现统计条目数多了的情况下,可以联合distinct来写,修改后如下:

select count(distinct(t.type)) as total from table t