admin 管理员组

文章数量: 1086019

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

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

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

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

本文标签: 数目 错误 MySQL count