title: MySQL: Get common records by user ID
body: <p>I have to think this is a relatively easy query but I'm stumped. I've got an achievements table, a users table, and a users_achievements table. I want to determine what achievements more than one user share in common based on what exists in the users_achievements table.</p>
  
  <pre><code>SELECT a.id, a.name, a.description, a.badge_path, b.earned_on 
  FROM achievements AS a 
  LEFT JOIN users_achievements AS b ON a.id=b.achievements_id 
  WHERE b.users_id=1 
    AND b.users_id=2
  </code></pre>
  
  <p>This returns no results even though the users with ids 1 and 2 share two common records from the users_achievements table based on the achievements_id (so 4 records total--one for each user for each achievement_id). If I use "OR" or "IN" I get records, but that's not inclusive of BOTH ids, just either...I need the query to qualify both IDs.</p>