title: MySQL display rows where value IS NULL or equal to X
body: <p>userPosts.value can contain one of two values: 0 or 1.</p>
  
  <p>I am Left Joining userPosts to my Posts table.</p>
  
  <p>I want to get all posts from my Posts table where userPosts.value = 0 as well as all posts that do not have any userPosts.value at all (thus, NULL).</p>
  
  <p>The following only get me posts where value = 0 but no NULL:</p>
  
  <pre><code>SELECT * FROM $wpdb-&gt;posts
  LEFT JOIN userPosts ON ($wpdb-&gt;posts.ID = userPosts.postID)
  WHERE userPosts.value != 1
  ORDER BY $wpdb-&gt;posts.post_date DESC
  </code></pre>
  
  <p>The following only gets me posts where value = NULL:</p>
  
  <pre><code>SELECT * FROM $wpdb-&gt;posts
  LEFT JOIN userPosts ON ($wpdb-&gt;posts.ID = userPosts.postID)
  WHERE userPosts.value IS NULL
  ORDER BY $wpdb-&gt;posts.post_date DESC
  </code></pre>
  
  <p>but this yields no results at all:</p>
  
  <pre><code>SELECT * FROM $wpdb-&gt;posts
  LEFT JOIN userPosts ON ($wpdb-&gt;posts.ID = userPosts.postID)
  WHERE userPosts.value = 0
  AND userPosts.value IS NULL
  ORDER BY $wpdb-&gt;posts.post_date DESC
  </code></pre>
  
  <p>and this does get me posts with value = 0 as well as NULL but it repeats all my NULL posts three times!</p>
  
  <pre><code>SELECT * FROM $wpdb-&gt;posts
  LEFT JOIN userPosts ON ($wpdb-&gt;posts.ID = userPosts.postID)
  WHERE userPosts.value = 0
  OR userPosts.value IS NULL
  ORDER BY $wpdb-&gt;posts.post_date DESC
  </code></pre>
  
  <p>So what am I doing wrong?</p>