mysql count() 函数,对结果统计计数

 

mysql> select * from table1 where minute(order_date)=46;
+----------+------------+-----+---------------------+
| name_new | transactor | pid | order_date          |
+----------+------------+-----+---------------------+
| 3hahha   | 3xiaohong  |   3 | 2019-08-04 20:46:02 |
| 4hahha   | 4xiaohong  |   4 | 2019-08-04 20:46:05 |
| 3hahha   | bob        |   5 | 2019-08-04 20:46:08 |
| 3hahha   | lee        |   6 | 2019-08-04 20:46:12 |
+----------+------------+-----+---------------------+
4 rows in set (0.00 sec)

mysql> select count(*) as num from table1 where minute(order_date)=46;
+-----+
| num |
+-----+
|   4 |
+-----+
1 row in set (0.00 sec)

 

 

posted @ 2019-08-04 21:36  anobscureretreat  阅读(1028)  评论(0编辑  收藏  举报