title: Difficulties using LEFT JOIN in MySQL
body: <p>I have two tables in the database:</p>
  
  <pre><code>Article
  --------------------------------------------
  articleID INTEGER PRIMARY KEY AUTOINCREMENT
  userID    VARCHAR
  
  Rating
  --------------------------------------------
  articleID INTEGER
  userID    VARCHAR
  rating    INTEGER
  </code></pre>
  
  <p>Sample data:</p>
  
  <pre><code>Article
  articleID        userID
  ---------------------------------
  1                12345
  2                23456
  3                23456
  4                99999
  5                15678
  
  Rating
  articleID        userID        rating
  --------------------------------------------
  1                12345         7.5
  2                12345         8.5
  2                31359         7.5
  1                24021         0.0
  1                25012         7.5
  </code></pre>
  
  <p>I want to get all the articles and show if I have rated them or not. I tried and I can only get the list with rated article with this statement:</p>
  
  <pre><code>SELECT a.*, rating AS myRating FROM Article AS a 
  LEFT JOIN Rating AS b
  ON a.articleID = b.articleID
  WHERE (b.userID is NULL || b.userID = "12345") 
  </code></pre>
  
  <p>How can I join the tables to get the result?</p>
  
  <pre><code>Expected output (with userID 12345)
  articleID        userID        myRating
  --------------------------------------------
  1                12345         7.5
  2                23456         8.5
  3                23456         NULL
  4                99999         NULL
  5                15678         NULL
  </code></pre>