mySQL - How to select a date interval
- by fabriciols
Hello,
this is my table :
-------------------------------------
| user | item | date_time |
| 10 | 01 | 10-10-10 20:10:05 |
| 10 | 02 | 10-10-10 20:10:10 |
| 10 | 03 | 10-10-10 20:10:10 |
| 20 | 02 | 10-10-10 20:15:10 |
| 20 | 02 | 10-10-10 20:20:10 |
| 30 | 10 | 10-10-10 20:01:10 |
| 30 | 20 | 10-10-10 20:01:20 |
| 30 | 30 | 10-10-10 20:05:20 |
-------------------------------------
i want to do a query that return a user that took multiple items in a 1min interval, like this result :
-------------------------------------
| user | item | date_time |
| 10 | 01 | 10-10-10 20:10:05 |
| 10 | 02 | 10-10-10 20:10:10 |
| 10 | 03 | 10-10-10 20:10:10 |
| 30 | 10 | 10-10-10 20:01:10 |
| 30 | 20 | 10-10-10 20:01:20 |
-------------------------------------
how i do this ?