title: How to treat MAX() of an empty table as 0 instead of NULL
body: <p>I try to select max value from table </p>
  
  <pre><code>SELECT MAX(cid) FROM itemconfiguration;
  </code></pre>
  
  <p>However when table <code>itemconfiguration</code> is empty the <code>MAX(cid)</code> statements is evaluated to <code>NULL</code> while i need a number. How to handle this and treat <code>NULL</code> as 0 ?</p>