Getting SQL Rows for Flight Data
Posted on 2016-08-27
I have a GPS device that captures data when we fly. The data is published to a web service, which I store in a SQL database. I know how to break the data into flight based on looking at it, but I am trying to tell SQL how to do it.
When the GPS unit fires up is sends a position report along with a field called MessageCode which is set to a value of 10 for the first record. The value then changes other values throughout the flight. The next flight is determined by the next MessageCode 10.
What I need:
1.) I need a select statement to grab all of the rows from the first messagecode 10, through the record just PRIOR to the next messageCode 10. This would be consider a single flight.
I am happy to send example data but I do not want to post it publically.