title: SQL:How to include empty or null Year in Group By
body: <p>I want to get the <code>COUNT</code> by year and include year with the empty or zero values</p>
  
  <p>heres my current query</p>
  
  <pre><code>SELECT YEAR(`date_incident`) as Year
  ,COUNT(`tblrespond`.`patient_no`) as Total  
  FROM  `tblrespond` 
  Inner Join `tblincident` 
  On `tblincident`.`incident_no` = `tblrespond`.`incident_no` 
  Inner Join `tblpatients` 
  On `tblpatients`.`patient_no` = `tblrespond`.`patient_no` 
  Group By YEAR(`date_incident`)
  </code></pre>
  
  <p>but this query skips the year with empty data</p>
  
  <p>what i want is to generate like this.</p>
  
  <pre><code>YEAR       Total
  -----     ------
  2011        10
  2012        7
  2013        0
  2014        12
  2015        0
  2016        5
  </code></pre>
  
  <p>in my current query. the year <code>2013</code> &amp; <code>2015</code> will be skipped.</p>
  
  <p>it has 3 relationship table <code>tblrespond</code>,<code>tblincident</code>,<code>tblpatients</code>
  both <code>tblincident</code> and <code>tblpatients</code> are connected to the <code>tblrespond</code>.</p>