title: PostgreSQL Error 22012 devided by Zero after Truncate The Table
body: <p>So after I truncated my table, this query which worked before, now doesn't work. Even I've already filled again my table, It still doesn't work. 
  Here's my postgreSQL code :</p>
  
  <pre><code>SELECT 
                       k.reviewer                                               AS namareviewer
                       , COUNT(k.formcode)                                        AS actual
                       , ROUND((0.2*COUNT(k.formcode)))                           AS target
                       , SUM(CASE WHEN k.blibliknowledge != '' THEN 1 ELSE 0 END) AS blibli
                       , COUNT(CASE WHEN k.solusi != '' THEN 'foo' ELSE NULL END) AS solusi
                       , ROUND(((COUNT(CASE WHEN k.solusi != '' THEN 'foo' ELSE NULL END)+ SUM(CASE WHEN k.blibliknowledge != '' THEN 1 ELSE 0 END)) /ROUND((0.2*COUNT(k.formcode))))*100,2) as Percentage
                    FROM kpi k
  
                   GROUP
                      BY k.reviewer
  </code></pre>
  
  <p>And my KPI Table 
  <a href="https://i.stack.imgur.com/vWQme.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vWQme.png" alt="enter image description here"></a></p>
  
  <p>That data are the same with the first data which the query already worked. Why The error SQL state : 22012 devided by zero come up after the first table truncated? Thankyou in advanced :D</p>