title: Default value in select query for null values in postgres
body: <p>I have a table with sales Id, product code and amount. Some places product code is null. I want to show <strong>Missing</strong> instead of null. Below is my table.</p>
  
  <pre><code>salesId     prodTypeCode    amount
  1           123              150
  2           123              200
  3           234             3000
  4           234              400
  5           234              500
  6           123              200
  7           111              40
  8           111              500
  9                           1000
  10          123              100
  </code></pre>
  
  <p>I want to display the total amount for every <code>prodTypeCode</code> with the option of If the prodTypeCode is null then <strong>Missing</strong> should be displayed. </p>
  
  <pre><code>select (CASE WHEN prodTypeCode IS NULL THEN
     'Missing'
      ELSE
      prodTypeCode
      END) as ProductCode, SUM(amount) From sales group by prodTypeCode
  </code></pre>
  
  <p>Above query giving error. Please suggest me to overcome this issue. I ahve created a <a href="http://sqlfiddle.com/#!15/9d25d/1" rel="noreferrer">SQLFIDDLE</a></p>