MySQL: Count the distinct rows per day
我有一个有趣的查询,我需要做。 我有一个包含
示例数据:
1 2 3 4 5 6 7 8 9 10 11 12 13 | PK | FK | ipNum | timestamp 11 | 404 | 219395 | 2013-01-06 22:23:56 7 | 404 | 467719 | 2013-01-06 22:23:41 8 | 404 | 4718869 | 2013-01-06 22:23:42 10 | 404 | 16777224 | 2013-01-06 22:23:56 5 | 404 | 1292435475 | 2013-01-06 22:23:25 12 | 404 | 1526990605 | 2013-01-06 22:23:57 6 | 404 | 1594313225 | 2013-01-06 22:23:40 4 | 404 | 1610613001 | 2013-01-06 22:23:23 9 | 404 | 1628635192 | 2013-01-06 22:23:55 1 | 404 | 2130706433 | 2013-01-06 21:29:38 2 | 407 | 2130706433 | 2013-01-06 21:31:59 3 | 407 | 2130706433 | 2013-01-06 21:32:22 |
1 2 3 |
- SQLFiddle演示
1 2 3 |
这会给你一个像样的结果
1 2 3 4 | ip TIME COUNTIPS 11.237.115.30 2018-01-27 19:13:51 1 21.744.133.52 2018-01-27 19:14:03 1 44.628.197.51 2018-01-27 19:48:12 14 |