title: Oracle query group by consecutive value and get start date and end date
body: <p>I have a table like this (actually, is the result of a large large query):</p>
  
  <pre><code>id   |  date_measured        |  out_of_range
  -----+-----------------------+--------------
  3147 |  09/08/2019 20.00:00  |  1
  3147 |  09/08/2019 21.00:00  |  0
  3147 |  09/08/2019 22.00:00  |  0
  3147 |  09/08/2019 23.00:00  |  1
  3147 |  10/08/2019 00.00:00  |  1
  3147 |  10/08/2019 01.00:00  |  1
  3147 |  10/08/2019 02.00:00  |  0
  3125 |  09/08/2019 20.00:00  |  0
  3125 |  09/08/2019 21.00:00  |  1
  3125 |  09/08/2019 22.00:00  |  1
  3125 |  09/08/2019 23.00:00  |  0
  3125 |  10/08/2019 00.00:00  |  1
  3125 |  10/08/2019 01.00:00  |  1
  3125 |  10/08/2019 02.00:00  |  1
  </code></pre>
  
  <p>and I need this result:</p>
  
  <pre><code>id   |  date_measured_start  |  date_measured_end    |  consecutive_out_of_range
  -----+-----------------------+-----------------------+--------------------------
  3147 |  09/08/2019 20.00:00  |  09/08/2019 20.00:00  |  1
  3147 |  09/08/2019 23.00:00  |  10/08/2019 01.00:00  |  3
  3125 |  09/08/2019 21.00:00  |  09/08/2019 22.00:00  |  2
  3125 |  10/08/2019 00.00:00  |  10/08/2019 02.00:00  |  3
  </code></pre>
  
  <p>that is the consecutive recurrence of the value <em>out_of_range = 1</em> and the relative start and end date.</p>
  
  <p>I tried to use <a href="https://stackoverflow.com/questions/46298871/oracle-sql-query-to-group-consecutive-records-by-date">this</a> solution but I just can't have only the consecutive <em>1</em> for the <em>out_of_range</em>. value.</p>