title: How to find the time gap(in minutes) between two records(two different columns) in an Oracle database
body: <p>I want to find the time gaps for different days between one end_time and nearest start_time in another record which is stored as follows:</p>
  
  <pre><code>record_id | start_time | end_time
  120 | 2019-09-01 08:05:00 | 2019-09-01 10:35:00 
  103 | 2019-09-01 10:45:00 | 2019-09-01 14:00:00
  108 | 2019-09-01 14:30:00 | 2019-09-01 18:00:00
  225 | 2019-09-02 07:30:00 | 2019-09-02 10:30:00
  245 | 2019-09-02 10:30:00 | 2019-09-02 13:40:00 
  250 | 2019-09-02 14:00:00 | null
  </code></pre>
  
  <p>Start_time and End_time are timestamp columns.</p>
  
  <p>Expected output is:</p>
  
  <pre><code>2019-09-01 | 10
  2019-09-01 | 30
  2019-09-02 |  0
  2019-09-02 | 20
  </code></pre>
  
  <p>Can anyone please help me on this?</p>