title: finding maximum in a range in sql
body: <p>i have a table </p>
  
  <pre><code>2006 .5
  2007 .6
  2008 .4
  2009 .7
  2010 .4
  </code></pre>
  
  <p>I have given a range eg. <code>2006-2010</code></p>
  
  <p>I want result like this: Whenever a max value is present the following years will have max number unless the next number is bigger than previous.</p>
  
  <pre><code>2006-2010  2006 .5
  2006-2010  2007 .6
  2006-2010  2008 .6
  2006-2010  2009 .7
  2006-2010  2010 .7
  </code></pre>
  
  <p>So this is what I have tried:</p>
  
  <p>I used a cross join and got</p>
  
  <pre><code>2006-2010  2006 .5
  2006-2010  2007 .6
  2006-2010  2008 .4
  2006-2010  2009 .7
  2006-2010  2010 .4  
  </code></pre>
  
  <p>However, I am not getting the right result. Is there anything I should use to get max value than previous year. Not sure if I was able to explain this well.</p>