This is my first post in this forum so it might not be perfect.
Here I go:
I have a MASSIVE database (SQL 2008) with data on vehicle speed for alot of vehicles that have been recorded.
The table consists of timestamp(hh/mm/ss) vehicle ID, speed.
Now, I need to find certain events, i.e overtakings. using this data.
Say that if the speed is > 70 then I consider it to be the beginning of an overtaking. The problem is that the overtaking takes some time and alot of data with values beyond this "triggervalue" is actually the same event. So I don't want every value over 70 to be selected.
What I want is that when the Query finds a value >70 then it should look at the values following this value (for 1 minute, remember all values has a timestamp) and select the maximum value and the go on to the next event.
Did it make sense?