title: Count non empty fields in MYSQL
body: <p>I have this simple MYSQL table1:</p>
  
  <pre><code>id
   1
   2
   3
  </code></pre>
  
  <p>AND this table2:</p>
  
  <pre><code> id | question | answer
    1 |  how     | 
    2 |  are     | fine
    3 |  you     | ok
  </code></pre>
  
  <p>And this simple query:</p>
  
  <pre><code>SELECT table1.id,COUNT(answer NOT NULL) FROM table1 LEFT JOIN table2
         ON table1.id = table2.id
  </code></pre>
  
  <p>I want to count non empty answer fields. I tried NOT NULL but it's not working as the <code>answer</code> column is <code>NOT NULL</code> and where is not applicable as it will lead the main query to return nothing</p>