title: adding condition when case statement is true in postgresql
body: <p>I have a query that where i need to put condition when case statement is true.I have tried like this but not geeting the correct value.</p>
  
  <pre><code>SELECT
      name,count(CASE WHEN date_part('year',time_stamp) = 2016 THEN answ_count end) AS Year15 
  FROM 
          companies companies 
  where 
  
      (CASE when no_answer='f' then value_s IS  not  NULL or value_n IS  not  NULL end )
  </code></pre>