title: How can I fold same value rows with time order in clickhouse?
body: <p>for example, status changed in time, how can I get the start time and end time for every status change.</p>
  <p>from: status, time</p>
  <pre><code>(1, '2020-11-08 01:00:01'), 
  (1, '2020-11-08 01:00:02'), 
  (2, '2020-11-08 01:00:03'), 
  (2, '2020-11-08 01:00:04'), 
  (2, '2020-11-08 01:00:05'), 
  (2, '2020-11-08 01:00:06'), 
  (1, '2020-11-08 01:00:07'), 
  (1, '2020-11-08 01:00:08')
  </code></pre>
  <p>to: status, start_time, end_time</p>
  <pre><code>1, '2020-11-08 01:00:01', '2020-11-08 01:00:02'
  2, '2020-11-08 01:00:03', '2020-11-08 01:00:06'
  1, '2020-11-08 01:00:07', '2020-11-08 01:00:08'
  </code></pre>