in reply to Calculate time difference
Could you state what you really need: I'm assuming that the table shows the status of a system vs time and you are trying to find the length of the periods in which the status had been up or down.
The approach should be different if you are looking for a single event (i.e. "how long status had been on before going down at xxxx") or you want to chart the up/down length from the entire table or you want to feed this data in another db table
|
|---|