title: MySQL: Get start & end timestamp for each day
body: <p>Similar to the question at <a href="https://stackoverflow.com/questions/22407016/mysql-find-start-and-end-timestamp-of-a-consecutive-count">MYSQL: Find Start and End Timestamp of a consecutive count</a>, I have a table with similar data:</p>
  
  <pre>
  StatusTime          | Reading   
  2014-01-01 00:00    | 255
  2014-01-01 01:00    | 255
  2014-01-01 02:00    | 255
  2014-01-01 03:00    | 255
  2014-01-01 04:00    | 255
  2014-01-01 05:00    | 241
  2014-01-01 06:00    | 189
  2014-01-01 07:00    | 100
  2014-01-01 08:00    | 20
  2014-01-01 09:00    | 0
  2014-01-01 10:00    | 1
  2014-01-01 11:00    | 1
  2014-01-01 12:00    | 0
  2014-01-01 13:00    | 21
  2014-01-01 14:00    | 1
  2014-01-01 15:00    | 0
  2014-01-01 16:00    | 12
  2014-01-01 17:00    | 63
  2014-01-01 18:00    | 102
  2014-01-01 19:00    | 198
  2014-01-01 20:00    | 255
  2014-01-01 21:00    | 255
  2014-01-01 22:00    | 255
  2014-01-01 23:00    | 255
  2014-01-02 00:00    | 255
  2014-01-02 01:00    | 255
  2014-01-02 02:00    | 255
  2014-01-02 03:00    | 255
  2014-01-02 04:00    | 255
  2014-01-02 05:00    | 208
  2014-01-02 06:00    | 100
  2014-01-02 07:00    | 48
  2014-01-02 08:00    | 0
  2014-01-02 09:00    | 0
  </pre>
  
  <p>I'd like to extract the <b>start</b> and <b>end</b> timestamps where readings go <b>above 50</b> and <b>below 50</b>, respectively. I just can't get my head around the SQL presented in the other answer!</p>
  
  <p>Thanks in advance for your help.</p>