title: Return zero if no record is found
body: <p>I have a query inside a stored procedure that sums some values inside a table:</p>
  
  <pre><code>SELECT SUM(columnA) FROM my_table WHERE columnB = 1 INTO res;
  </code></pre>
  
  <p>After this select I subtract <code>res</code> value with an integer retrieved by another query and return the result. If <code>WHERE</code> clause is verified, all works fine. But if it's not, all my function returns is an empty column (maybe because I try to subtract a integer with an empty value).</p>
  
  <p>How can I make my query return zero if the <code>WHERE</code> clause is not satisfied?</p>