EDIT :Different example : i have a car i check every minute the cars speed. Now i want to know for how many hours the car was driving at a specific speed. i have timestamp and x = speed /*******************************************************************************/
I have a table with Timestamps and a value X. Is it possible to get the time in hours for a specific X? And if possible for all data or a specific year or month. The timestamp is every min, but there can be gaps too.
time x
1.01.16 20:59:22 50
1.01.16 21:00:22 40
1.01.16 21:01:22 40
1.01.16 21:02:25 40
1.01.16 21:04:25 40
1.01.16 21:06:25 40
. .
output example
hours x
X ? 50
X ? 40
I have a timestamp in a period of 1-2 min, sometimes there is no data for days or months. I need to know how many hours there was x.
EDIT:
For better unterstanding. I have timestamps and a value X. If i had 60 Timestamps in 1 hour with value X i would know that X was for 1 hour.But i dont have 60 timestamps i have sometimes only 30 or 2 or none. how can i do this with gaps?
time x
1.01.16 21:00:00 40
1.01.16 21:01:00 40
1.01.16 21:02:00 40
1.01.16 21:03:00 40
1.01.16 21:04:00 40
1.01.16 21:05:00 40
....
1.01.16 22::00 40
OUTPUT:
hours x
1 40
EDIT : ^^ Different example : i have a car i check every min the cars speed. Now i want to know for how many hours the car was driving at a specific speed.