我可以同时使用COUNT()和DISTINCT吗? [英] Can I use COUNT() and DISTINCT together?
本文介绍了我可以同时使用COUNT()和DISTINCT吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想计算mysql表中的行数,而不要包含重复的条目,
I would like to count the number of rows from a mysql table and not to include duplicate entries,
我可以将distinct
与count()
一起使用吗?
Could I use distinct
with count()
?
推荐答案
可以.
SELECT COUNT(DISTINCT column) FROM table;
这篇关于我可以同时使用COUNT()和DISTINCT吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文