title: Get value zero if data is not there in PostgreSQL
body: <p>I have a table <code>employee</code> in Postgres:</p>
  
  <p>Query:</p>
  
  <pre><code>SELECT DISTINCT month_last_date,number_of_cases,reopens,csat
  FROM employee
  WHERE month_last_date &gt;=(date('2017-01-31') - interval '6 month')
  AND   month_last_date &lt;= date('2017-01-31')
  AND agent_id='analyst' 
  AND name='SAM';
  </code></pre>
  
  <p>Output:</p>
  
  <p><img src="https://i.stack.imgur.com/qSee2.png" alt="Output I get"></p>
  
  <p>But if data is not in table for other month I want column value as <strong><code>0</code></strong>.</p>
  
  <p><img src="https://i.stack.imgur.com/xv3ju.png" alt="Required output"></p>