最新消息:20210917 已从crifan.com换到crifan.org

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

MySQL crifan 4912浏览 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,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
99 queries in 0.187 seconds, using 23.45MB memory