title: I have a table that holds date and the corresponding values. I want to write a sql query in a way it fills up the missing dates
body: <p>I have a table that holds date and their corresponding values. I want to write a query to fill in the missing dates and fill the values column with the value of the previous date.</p>
  <pre><code>DATE_         CURR            VALUE
  2020-12-31    Dollar USA      73,8757
  2020-12-30    Dollar USA      73,6567
  2020-12-29    Dollar USA      73,7175
  2020-12-26    Dollar USA      73,6921
  2020-12-25    Dollar USA      74,8392
  2020-12-24    Dollar USA      75,4571
  </code></pre>
  <p>OUTPUT:</p>
  <pre><code>DATE_         CURR            VALUE
  2020-12-31    Dollar USA      73,8757
  2020-12-30    Dollar USA      73,6567
  2020-12-29    Dollar USA      73,7175
  2020-12-28    Dollar USA      73,7175
  2020-12-27    Dollar USA      73,7175
  2020-12-26    Dollar USA      73,6921
  2020-12-25    Dollar USA      74,8392
  2020-12-24    Dollar USA      75,4571
  </code></pre>
  <pre><code>with d as (
     select 
        min(DATE_) mi, 
        max(DATE_) mx, 
        max(DATE_) - min(DATE_) num 
     from CURR_TRAN), 
  d1 as (
     select 
        level-1 + mi DATE_ 
     from d CONNECT by level &lt;= num+1) 
  
  select 
     d1.DATE_,
     last_value(VALUE ignore nulls) over (order by d1.DATE_) VALUE 
  from d1 
  left outer join CURR_TRAN on (d1.DATE_=CURR_TRAN.DATE_) 
  order by d1.DATE_;
  </code></pre>