title: generate list of minutes between two dates (SQL)
body: <p>Hi stackoverflow community,</p>
  
  <p>I would like to achieve the following.</p>
  
  <p>I currently have tbl1. But i would like to achieve a constant stream of data between dt_sta_cet and dt_sto_cet(see desired table)
  and also a constant data stream between dt_sto_cet from one row and dt_sta_cet from the next row.</p>
  
  <pre><code>Tbl1
  
  id  dt_sta_cet        dt_sto_cet         s_t
  1   2019-12-13 09:00  2019-12-13 09:05    DT
  1   2019-12-13 09:10  2019-12-13 09:14    DT
  1   2019-12-13 09:17  2019-12-13 09:20    DT
  </code></pre>
  
  <p>Tbl1(desired)</p>
  
  <pre><code>id  dt                   s_t    u_t
  1   2019-12-13 09:00      DT    null
  1   2019-12-13 09:01      DT    null
  1   2019-12-13 09:02      DT    null
  1   2019-12-13 09:03      DT    null
  1   2019-12-13 09:04      DT    null
  1   2019-12-13 09:05      DT    null
  1   2019-12-13 09:06      null   Y
  1   2019-12-13 09:07      null   Y
  1   2019-12-13 09:08      null   Y
  1   2019-12-13 09:09      null   Y
  1   2019-12-13 09:10      DT     Y
  1   2019-12-13 09:11      DT     Y
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>To get the Dt_sta_cet/ dt_sto_cet time i have the following query.</p>
  
  <pre><code>    With tbl1 as ( select d.a_s_t, mach.a_id,
  
   to_char(to_date(f.f_sto_sta_dt_id,'YYYYMMDD') + (f.f_sto_sta_time_id/86400),
      'YYYY-MM-DD HH24:MI:SS') as sto_sta_dt
      ,to_char(to_date(f.f_sto_sto_dt_id,'YYYYMMDD') + (f.f_sto_sto_time_id/86400),
      'YYYY-MM-DD HH24:MI:SS') as sto_sto_dt
  
      from f_sto f
      left join d_sto d on f.f_sto_id= d.k_id
      left join d_mach mach on f.f_mach_id=mach.k_id
      where d.a_s_t = 'DT')
  
      select tbl1.a_id, tbl1.sto_sta_dt, tbl1.sto_sto_dt, tbl1.a_s_t,
      to_char(to_date(st_sta_dt, 'YYYY-MM-DD HH24:MI:SS')-1/24, 'YYYY-MM-DD HH24:MI:SS' as dt_sta_cet
      , to_char(to_date(st_sto_dt, 'YYYY-MM-DD HH24:MI:SS')-1/24, 'YYYY-MM-DD HH24:MI:SS' as dt_sto_cet 
  </code></pre>