title: TSQL Group-By Over Two Columns
body: <p>Hi Thanks in advance for helping. I have the following table:</p>
  
  <pre><code>create table temp_vol (symbol nchar(10), dseqkey int, volume float)
  </code></pre>
  
  <p>here are some values in the table:</p>
  
  <pre><code>symbol     dseqkey    volume (no commas in the actual values)
  C          20672      422,764,512 
  F          20672       47,144,600 
  F          20671       51,695,000 
  C          20671      371,950,496 
  F          20670       48,680,600 
  C          20670      654,208,512 
  C          20669      626,121,600 
  F          20669       93,489,504 
  C          20668      712,674,304 
  </code></pre>
  
  <p>The output I am seeking is a 2-day simple moving average ((volume dseqkey + volume dseqkey-1) / 2) for each symbol, for each dseqkey. I can get the moving average working for all symbols across one dseqkey. I can get the moving average working for all dseqkeys across 1 symbol. I cannot seem to get both working together. </p>