title: PostgreSQL get relative average with group by
body: <p>I have a table as follows. The rows are in a specific order.</p>
  
  <pre><code>id    |      value
  ------+---------------------
   1    |        2
   1    |        4     
   1    |        3
   2    |        2
   2    |        2
   2    |        5
  </code></pre>
  
  <p>I would want to group the rows by the column 'id' and get the average of value displayed in each column in terms of the previous values of the column (As explained in the following example within brackets)</p>
  
  <pre><code>id    |      value  |    RelativeAverage    
  ------+-------------+--------------------
   1    |        2    |        (2/1) = 2
   1    |        4    |        (2+4 /2) = 3
   1    |        3    |        (2+4+3 / 3) = 3
   2    |        2    |        (2/1) = 2
   2    |        2    |        (2+2 / 2) = 2
   2    |        5    |        (2+2+5 / 3) = 9
  </code></pre>
  
  <p>Is there an approach with which I can achieve this?</p>
  
  <p>Thanks in Advance</p>