title: Group by and aggregate when colums change over time in Clickhouse
body: <p>Assume I have following table in Clickhouse:</p>
  <pre><code>f_datetime, f_user, f_tile
  2021-07-08 07:00:00, x, a
  2021-07-08 08:30:00, x, a
  2021-07-08 08:45:00, x, a
  
  2021-07-08 09:00:00, x, b
  2021-07-08 11:00:00, x, b
  
  2021-07-08 12:00:00, x, a
  2021-07-08 15:00:00, x, a
  
  2021-07-08 16:00:00, x, b
  2021-07-08 20:00:00, x, b
  </code></pre>
  <p>I want an aggregate query to get following results:</p>
  <pre><code>f_user, f_tile, f_duration
  x, a, 105
  x, b, 120
  x, a, 180
  x, b, 240
  </code></pre>
  <p>I want to Grouping and calculate duration until f_tile, f_user  changes in an ordered table by f_datetime.</p>
  <p>Is there any solution?</p>