title: MYSQL Left Join how do I select NULL values?
body: <p>This is a follow up question to my last question about table joins in MySQL</p>
  
  <p>I need to be able to select the NULL values from the left joined table.</p>
  
  <p>Here's my join:</p>
  
  <pre><code>table1.id | table1.name | table2.id | table2.surname
          1 |        John |         1 |            Doe
          2 |     Michael |         2 |       Anderson
          3 |        Anna |      NULL |           NULL
          4 |         Sue |      NULL |           NULL
  </code></pre>
  
  <p>I would want to <code>select WHERE table2.surname = NULL</code>, but a query like this doesn't work:</p>
  
  <pre><code>SELECT table1.*,table2.*
  FROM table1
  LEFT JOIN table2
      ON table1.id=table2.id
  WHERE table2.surname=NULL
  </code></pre>
  
  <p>I can somewhat understand  the logic behind it not giving me any results, but there must be a way to grab them results?</p>
  
  <p>Appreciate any help.</p>