title: Select in with join giving odd results
body: <p>I have the below query which on the face seems to be working fine however its giving some strange results which im not sure are data issues or something wrong with the query itself. </p>
  
  <p>The query is of the form:</p>
  
  <pre><code>SELECT j.username, u.email, u.accountType
  FROM users u JOIN
       j_users j
       ON j.email = u.email
  WHERE j.email IN (select email FROM j_users);
  </code></pre>
  
  <p>The <code>users</code> table may have many entries for the same email address, although the <code>accountType</code> will be different. However within the <code>j_user</code> table <code>email</code> is unique Whats strange here is the query is presenting results like:</p>
  
  <pre><code>|bob  |bob@gmail.com  |admin|
  |bob  |bob@gmail.com  |user |
  |     |bob@gmail.com  |mod  |
  |steve|steve@gmail.com|admin|
  |     |steve@gmail.com|user |
  |     |steve@gmail.com|mod  |
  </code></pre>
  
  <p>Is there anything that can be seen from the query that could explain this? or a better way to extract the data I am interested in (all the values from <code>users</code> table who have an email in <code>j_users</code>) </p>
  
  <p><em>EDIT</em> </p>
  
  <p>Thank you for pointing out the redundancy however my main issue still stands, some rows in the returned result set have no username, yet in the <code>j_user</code> table this is a required field and every row has one set. As already set each email is unique in this table as well so if the username is showing against one row surely it should show against all rows with the same email address?</p>