title: aggregate of an empty result set
body: <p>I would like the aggregates of an empty result set to be 0. I have tried the following:</p>
  
  <pre><code>SELECT SUM(COALESCE(capacity, 0))
    FROM objects
   WHERE null IS NOT NULL;
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>sum 
  -----
  
  (1 row)
  </code></pre>
  
  <p>Subquestion: wouldn't the above work in Oracle, using <code>SUM(NVL(capacity, 0))</code>?</p>