I am having some issues figuring out how to generate the SQL script to do the following. (Refer to screenshot below)
I basically have a bunch of values which go into a bad state, then into a good state, then bad, then good etc. over a given time period
For a given timestamp when a value goes...