title: Inner join query returning all NULL result when it should return no result
body: <p>This query is returning 1 record with all <code>NULL</code> values when there should not be a result. When there should be a result it seems to return fine. </p>
  
  <p>I use inner joins to grab some account details and ratings using their table primary keys. Some of the non-primary (many to one) keys have default of NULL - maybe this causes it to join on itself somehow?</p>
  
  <p>Why is it returning a row with all null values?</p>
  
  <pre><code>SELECT a.account_id, a.first_name, a.second_name, a.points, c.body, c.creation_time, AVG(t.rating_overall)
  FROM comments AS c
  INNER JOIN accounts AS a
  ON c.account_id=a.account_id
  INNER JOIN ratings AS t
  ON t.blogger_id=a.account_id
  WHERE c.blog_id = ?
  ORDER BY c.creation_time ASC"
  </code></pre>