title: postgres aggregate function calls may not be nested
body: <p>I have a query:</p>
  
  <pre><code>    select sum(
          sum((Impressions / Count) * Volume) / sum(Volume)
      ) as frequency 
      from datatable;
  </code></pre>
  
  <p>however I cannot execute this in postgres because it uses nested aggregations. Is there another way to write this without using nested aggregations? </p>