title: T-SQL- include sum of count(*) in single query
body: <p>Using table i and the fields date_entered and code, I wrote a query to list a count for each year where code = '12A'.</p>
  
  <pre><code>select distinct year(date_entered) as Yr, count(*) as Cnt
  from i
  where code = '12A'
  group by year(date_entered)
  order by Yr desc
  </code></pre>
  
  <p>This produces:</p>
  
  <pre><code>Yr   |    Cnt
  2011   |  780
  2010   |  3489
  2009   |  3256
  ...
  </code></pre>
  
  <p>I want to include a sum of the Cnt variable in my result set.  I know how to find the sum using a separate query, but I would like to calculate the sum in my original query.  </p>