title: SQL Query to fill missing gaps across time and get last non-null value
body: <p>I have the following table in my database:</p>
  
  <pre><code>Month|Year | Value
     1 |2013 | 100
     4 |2013 | 101
     8 |2013 | 102
     2 |2014 | 103
     4 |2014 | 104 
  </code></pre>
  
  <p>How can I fill in "missing" rows from the data, so that if I query from 2013-03 through 2014-03, I would get:</p>
  
  <pre><code>Month|Year | Value
     3 |2013 | 100
     4 |2013 | 101
     5 |2013 | 101
     6 |2013 | 101
     7 |2013 | 101
     8 |2013 | 102
     9 |2013 | 102
    10 |2013 | 102
    11 |2013 | 102
    12 |2013 | 102
     1 |2014 | 102
     2 |2014 | 103
     3 |2014 | 103
  </code></pre>
  
  <p>As you can see I want to repeat the previous <code>Value</code> for a missing row.</p>