TABLE quotation
id clientid
1 25
2 25
3 25
4 25
5 26
如何查询有多少个不同的客户端TABLE quotation
?我不希望重复的条目被计算多次。
我需要的答案是2
,在 1 行中,因为唯一的非重复条目是 (25
, 26
).
select count(distinct clientid) from quotation
阅读更多 http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_count-distinct
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)