title: Avg, partition and where SQL Server 2012
body: <p>Here is my example </p>
  
  <p><a href="http://sqlfiddle.com/#!6/34cf0/6" rel="nofollow">SQLfiddle.com</a>. </p>
  
  <p>Could anybody explain why <code>AvgQuant</code> is invalid column name?</p>
  
  <p>Also SQLfiddle is great tool, but how do I set rounding settings? For example, rounding is not correct in the following example (just remove where clause)</p>
  
  <pre><code>SELECT [Location]
    ,Avg([Quantity]) over (partition BY LOCATION) AS AvgQuant
    ,[Street]
  FROM tblExample;
  </code></pre>
  
  <p>Regards</p>