So I am a bit stumped, I know how to do this theoretically but I am having trouble executing it in practice.
Basically I have a table and a revisions table. The table reflects the status as of now and the revisions table reflects the past status of the table.
id3, id2, id1, title, timestamp, status,
56456 229299 4775 x name 1432866912 0
56456 232054 123859 x name 1434000054 1
56456 235578 16623 x name 1435213281 1
56456 237496 139811 x name 1464765447 1
56456 381557 0 x name 1487642800 1
56456 616934 186319 x name 1496103368 1
56456 668046 246292 x name 1505386262 1
56456 766390 246292 x name 1523273582 1
Basically what I want is to look at the historical live/offline
status of all entries in the table. So I know the current status is live
, and I know the dates the entry was offline/live
as well.
What I want to do is calculate the live or offline dates between the timestamps. The dates between 1 -> 0 Are live dates. The dates between 1 -> Are live dates. The dates Between 0 -> 1 Are offline dates and the dates between 0 -> 0 Are offline dates.
So ideally my data would have a live/offline status delineated by each day in between each of these status changes.
I.E
The the output would display the dates between Timestamp 1432866912
& 1434000054
as the Status being Offline
I tried searching but didn't see anything relevant.
EDIT:
@RaymondNijland The first row has a unixtimestamp for the date May 28, 2015
& the second row a timestamp of the date June 11, 2015.
The first row is offline
and the second row is live.
So I basically want my data to look like this
Date Status
May 28, 2015 Offline
May 29, 2015 Offline
May 30, 2015 Offline
....
....
June 9, 2015 Offline
June 10, 2015 Offline
June 11, 2015 Live
June 12, 2015 Live
I need to do it this way because our database doesn't store the data on a daily basis, but only when a change is made to the data.