title: SQL IS NOT NULL not working
body: <p>I am attempting to write a short SQL query (in MySQL Workbench) that outputs the number of fails in a subject if it has been failed by more than one student.</p>
  
  <p>Here's my attempt:</p>
  
  <pre><code>SELECT CONCAT(area, yearlevel, code) AS SubjectCode, Count(student)
  FROM StudentTakesSubject
  WHERE result &lt; 50 AND result &lt;&gt; NULL
  GROUP BY code
  HAVING Count(Student) &gt; 1;
  </code></pre>
  
  <p>The problem is it keeps outputting the count which contains the Null record even though I have specified in the query to not count them (or at least I thought I did...).</p>
  
  <p><strong>EDIT :</strong> 
  It was the <code>GROUP BY</code> clause that went wrong! As <strong>Gordon Linoff</strong> has pointed out in his answer, it should have been <code>GROUP BY SubjectCode</code> and that magically solved the problem. </p>
  
  <p>Thank you all for the constructive insights.</p>