SQLite Forum

Time difference between two records
Login
This seems to be assuming that the rows are inserted in the start time sequence. True? Do we know that is how the OP's data is stored?  
Can this view be written where the sequence of the inserts is not known, so you have a set of values in no specific order and have to rely on an "order by" to list the set in sequence?