title: RIGHT JOIN not returning the right number of rows
body: <pre class="lang-sql prettyprint-override"><code>$sql="SELECT MAX(mr.messageId) AS maxMessageId, mr.threadId 
        FROM messages_recipients AS mr
        RIGHT JOIN thread_recipients AS tr ON tr.threadId=mr.threadId
        WHERE mr.recipientUserId='2'
        GROUP BY mr.threadId";
  </code></pre>
  
  <p>If the above SELECT should find a row in message_recipients with a threadId of 1
  and thread_recipients has multiple rows with threadId=1.. 
  then because I have a RIGHT JOIN,
  I would expect it to return as many rows as the number of rows in thread_recipients where threadId=1</p>
  
  <p>It is however only returning one row regardless... Can you tell me why it is doing this?</p>