title: How to get data using timestamp when there is gap between timestamp then the count of gap records to be displayed in a row in oracle
body: <p>I have a small requirement to solve.</p>
  
  <p>We have data with every half an hour records starts with 27-09-2018 00:00:00.from the start of day.</p>
  
  <pre class="lang-none prettyprint-override"><code>Meter_id |Realtimeclock      |I_Y|I_B|I_X|
  201010   |27-09-2018 00:00:00|1.0|2.0|3.0|
  201010   |27-09-2018 00:30:00|1.0|2.0|3.0|
  201010   |27-09-2018 01:00:00|1.0|2.0|3.0|
  201010   |27-09-2018 01:30:00|1.0|2.0|3.0|
  201010   |27-09-2018 02:00:00|1.0| 0 |3.0|
  201010   |27-09-2018 02:30:00|1.0| 0 |0  |
  201010   |27-09-2018 03:00:00|1.0|2.0|3.0|
  201010   |27-09-2018 03:30:00|1.0|2.0|3.0|
  </code></pre>
  
  <p>From the above table we have to get data as 27-09-2018 00:00:00 of realtimeclock to 27-09-2018 01:30:00 of realtimeclock  as one record of count,
  and see there was value 0 in I_B and I_X in both the timestamps 27-09-2018 02:00:00 and 27-09-2018 02:30:00 ,,so here we can skip these two records and continue with remaining data which starts at 27-09-2018 03:00:00 of realtimeclock and ends at 27-09-2018 03:30:00 and that should be represented as another record with count.</p>
  
  <p>like here output should be,</p>
  
  <pre class="lang-none prettyprint-override"><code>Meter_id |start_time         |End_time           |I_Y|I_B|I_X|
  201010   |27-09-2018 00:00:00|27-09-2018 01:30:00|4  |4  |4  |
  201010   |27-09-2018 03:00:00|27-09-2018 03:30:00|2  |2  |2  |
  </code></pre>