最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]MySQL中统计某列的不重复的个数

MySQL crifan 5689浏览 0评论

mysql count column

MySQL – Count Number of Unique Values – Stack Overflow

mysql – How do I count columns of a table – Stack Overflow

MariaDB [guanzhi_removeDuplicate]> SELECT count( DISTINCT(staff_id) ) FROM selection;
+—————————–+
| count( DISTINCT(staff_id) ) |
+—————————–+
|                         279 |
+—————————–+
1 row in set (0.02 sec)
MariaDB [guanzhi_removeDuplicate]>

[总结]

用:

SELECT count( DISTINCT(ColumnName) ) FROM TableName;

去显示某列的,独一无二,不重复,的个数。

转载请注明:在路上 » [已解决]MySQL中统计某列的不重复的个数

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.183 seconds, using 22.15MB memory