@
Iamnotfish 尝试了一下,得到的结果好像不是我想要的。
---
补充一下原来的题目:
data
| id | phoneNum | callType | created |
| --- | ----------- | -------- | ---------------- |
| 1 | 15000000000 | 1 | 2019-08-07 01:02 |
| 2 | 15000000000 | 1 | 2019-08-07 02:03 |
| 3 | 15000000000 | 2 | 2019-08-07 04:05 |
| 4 | 15000000000 | 1 | 2019-08-07 05:07 |
| 5 | 15000000000 | 2 | 2019-08-07 06:07 |
| 6 | 15000000000 | 1 | 2019-08-07 06:20 |
| 7 | 15000000000 | 1 | 2019-08-07 06:30 |
| 8 | 15000000001 | 1 | 2019-08-07 07:07 |
| 9 | 15000000000 | 1 | 2019-08-07 08:07 |
| 10 | 15000000000 | 1 | 2019-08-08 08:07 |
result
| phoneNum | callType | created | count |
| -------------- | -------- | ---------------- | ----- |
| 15000000000 | 1 | 2019-08-07 02:03 | 2 |
| 15000000000 | 2 | 2019-08-07 04:05 | 1 |
| 15000000000 | 1 | 2019-08-07 05:07 | 1 |
| 15000000000 | 2 | 2019-08-07 06:07 | 1 |
| 15000000000 | 1 | 2019-08-07 06:30 | 2 |
| 15000000001 | 1 | 2019-08-07 07:07 | 1 |
| 15000000000 | 1 | 2019-08-07 08:07 | 1 |
| 15000000000 | 1 | 2019-08-08 08:07 | 1 |