title: Oracle Find and Rewrite Consecutive Rows
body: <p>I have a table that includes rows like ;</p>
  
  <pre><code>ID  DATE
  1   1.01.2018 13:30
  1   1.01.2018 13:31
  2   1.01.2018 13:32
  2   1.01.2018 13:33
  1   1.01.2018 13:34
  3   1.01.2018 13:35
  3   1.01.2018 13:35
  3   1.01.2018 13:35
  3   1.01.2018 13:36
  1   1.01.2018 13:37
  3   1.01.2018 13:38
  4   1.01.2018 13:39
  4   1.01.2018 13:40
  1   1.01.2018 13:40
  </code></pre>
  
  <p>I want to find start and end dates of events.</p>
  
  <p>Desired Output;</p>
  
  <pre><code>ID    START_DATE              END_DATE
  1   1.01.2018 13:30     1.01.2018 13:31
  2   1.01.2018 13:32     1.01.2018 13:33
  1   1.01.2018 13:34     1.01.2018 13:34
  3   1.01.2018 13:35     1.01.2018 13:36
  1   1.01.2018 13:37     1.01.2018 13:37
  3   1.01.2018 13:38     1.01.2018 13:38
  4   1.01.2018 13:39     1.01.2018 13:40
  1   1.01.2018 13:40     1.01.2018 13:40
  </code></pre>
  
  <p>in ordered date If same id continues </p>
  
  <ul>
  <li><p>start date = it is first date</p></li>
  <li><p>end date = it is last date until id changes </p></li>
  </ul>
  
  <p>How can I write this query?</p>
  
  <p>Thank you.</p>