title: SQL alternative to inner join
body: <p>I have a table which has data that appears as:</p>
  
  <pre><code>Staion  Date        Temperature
  A      2015-07-31   8
  B      2015-07-31   6
  C      2015-07-31   8
  A      2003-02-21   4
  B      2003-02-21   7
  C      2003-02-21   7
  </code></pre>
  
  <p>For each date I need to create arrays so that it has the following combination:</p>
  
  <pre><code>c1 = (A + B)/2, c2 = (A + B + C)/3 and c3 = (B + C)/2
  </code></pre>
  
  <p>Right I am doing three different <code>inner join</code> on the table itself and doing a final <code>inner join</code> to achieve the following as result:</p>
  
  <pre><code>Date         c1    c2      c3
  2015-07-31   7     7.33    7
  2003-02-21   5.5   6       7
  </code></pre>
  
  <p>Is there a cleaner way to do this?</p>