let's assume i have follow table
| ID | teamid | timestamp |
| 5 | 1 | 2013-07-27 10:19:00 |
| 6 | 2 | 2013-07-27 10:20:00 |
| 7 | 1 | 2013-07-27 10:25:00 |
| 8 | 3 | 2013-07-27 10:26:00 |
| 9 | 1 | 2013-07-27 10:28:00 |
| 10 | 2 | 2013-07-27 10:29:00 |
| 11 | 3 | 2013-07-27 10:30:00 |
| 13 | 3 | 2013-07-27 10:31:00 |
What i need is the records where the interval between the timestamp is lower then 4 minutes and grouped by the team id
so output need looks like
| 7 | 1 | 2013-07-27 10:25:00 |
| 9 | 1 | 2013-07-27 10:28:00 |
| 11 | 3 | 2013-07-27 10:30:00 |
| 13 | 3 | 2013-07-27 10:31:00 |
can someone show me the correct way to solve
tnx
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…