title: SQLServer Calculate Average of Multiple Columns
body: <p>I have generated a table using PIVOT and the ouput of columns are dynamic. One of the output is as given below:</p>
  
  <pre><code>user       test1   test2    test3 
  --------------------------------
  A1          10      20       30  
  A2          90      87       75
  A3          78      12       34
  </code></pre>
  
  <p>The output of above table represents a list of users attending tests. The tests will be added dynamically, so the columns are dynamic in nature.</p>
  
  <p>Now, I want to find out average marks of each user as well as average marks of each test.</p>
  
  <p>I am able to calculate the average of each test, but got puzzled to find out the average of each user.</p>
  
  <p>Is there a way to do this??</p>
  
  <p>Please help.</p>
  
  <p>Mahesh</p>