I have a table with a timestamp, and I want to get all the records with a difference of 10 minutes between each other. I will give you an example: I have 4 dates in my database:
01-12-2015 15:45:10
01-12-2015 15:55:10
01-12-2015 15:25:10
01-12-2015 15:15:10
I want to get only 2 dates that have a difference of 10 minutes between each other.
I do not want to receive all records where the timestamp is within 10 minutes of the current timestamp. I want to select all records that have a difference of 10 minutes between them. So in my example, I want to select dates:
01-12-2015 15:45:10
01-12-2015 15:55:10
These 2 dates should have a difference of 10 minutes between them. How can i do this?
source
share