title: Sql query to Count Total Consecutive Years from latest year
body: <p>I have a table Temp:</p>
  
  <pre><code> CREATE TABLE Temp 
  ( 
    [ID]  [int],
    [Year]  [INT],
   )
  **ID    Year**
  1 2016
  1   2016
  1   2015
  1   2012
  1   2011
  1   2010
  2   2016
  2   2015
  2   2014
  2   2012
  2   2011
  2   2010
  2   2009
  3   2016
  3   2015
  3   2004
  3   1999
  4   2016
  4   2015
  4   2014
  4   2010
  5   2016
  5   2014
  5   2013
  </code></pre>
  
  <p>I want to calculate the total consecutive years starting from the most recent Year.
  Result should look like this:</p>
  
  <pre><code>ID  Total Consecutive Yrs
  1   2
  2   3
  3   2
  4   3
  5   1
  </code></pre>