title: MYSQL syntax not evaluating not equal to in presence of NULL
body: <p>I am having trouble with a mysql query.  I want to exclude values of 2.  So I thought I would do following:</p>
  
  <pre><code>table products
  
  id | name     | backorder
  -------------------
  1  | product1 | NULL
  2  | product2 | NULL
  3  | product3 | 2
  
  SELECT name from `products` p
  WHERE backorder &lt;&gt; '2'
  </code></pre>
  
  <p>However, This is not giving the desired result of product1, product 2  It is giving an empty results table.</p>
  
  <p>On the other hand if I use </p>
  
  <pre><code>SELECT name from `products` p
  WHERE backorder = '2'
  </code></pre>
  
  <p>Then it produces: <code>product3</code>.  But I want to get those records where it is not equal to <code>2</code>.</p>
  
  <p>Something is not working with the <code>&lt;&gt; '2'</code>.  Could it be that the <code>NULL</code> values are throwing it off?  Can anyone suggest a fix.</p>
  
  <p>Thanks in advance!</p>