What do I have to use in SQL SERVER 2008 to pick up the line before a certain closing. For example if in my where below if the alert is = 99 I want to know the alert and the speed before the alert.
Speed Data Alerta
58 '2017-09-13 10:08:04.290' 44
20 '2017-09-13 10:08:51.340' 99
56 '2017-09-13 10:09:21.450' 204
40 '2017-09-13 10:09:27.470' 99
34 '2017-09-13 10:09:37.570' 204
In this example there were two alert 99 where it was at a speed of 20 and 40 km, I want to return this line before the alert with the highest speed:
Speed Data Alerta
56 '2017-09-13 10:09:21.450' 204