I\'m quite new to SQL and this may be a noob question, but here it goes.
I have a table which has a timestamp and inCycle status of a machine. I\'m using two CTE\'s