title: Average of two columns in SQL
body: <p>I wanted to take average of two columns and display in a new column something like this:</p>
  
  <pre><code>+-+--+--+--+--------+--------+
  |A|B |C |D |AVG(B/C)|AVG(C/B)|
  +-+--+--+--+--------+--------+
  |S|23|34|56|        |        |
  +-+--+--+--+--------+--------+
  |T|45|6 |79|        |        |
  +-+--+--+--+--------+--------+
  </code></pre>
  
  <p>So, as shown above, I needed to take the each row values and perform B/C and then take the average accordingly to display it in a new column.</p>
  
  <p>I wanted to do this in SQL query. Is it possible to perform this in a SQL command? I know the <code>AVG()</code> function does take the average of a column but how can I do <code>B/C</code> and then take the average? also if I need to take the average of B and C as well how can i do that.</p>
  
  <p>This is what I am doing right now:</p>
  
  <pre><code>Select A,B,C,D FROM tableTest where A='S';
  </code></pre>
  
  <p>I now have to take the average of corresponding and also have another two columns additionally in the query to show the respective results.</p>