title: Differences between two result sets MySQL
body: <p>Very beginner question but haven't been able to come up with answer after reading various help resources.</p>
  
  <p>I have a table group_affiliations which is a joining table between the tables users and groups. Relevant columns: <code>Id</code>, <code>user_id</code>, <code>group_id</code>. I am doing a data cleanup where users were assigned a group_id based on a location which used to be a 3 character abbreviation of a city but has since gone to spelling out full city (ex: a <code>group_id</code> for CHA was previously assigned and now a <code>group_id</code> for Charlotte). Most users currently have both <code>group_id</code>s associated with their user_id but some still only have the old <code>group_id</code> and were never assigned the new one.</p>
  
  <p>What is the most efficient way of finding which ids are in this result set:</p>
  
  <pre><code>select user_id from group_affiliations where group_id=OldId;
  </code></pre>
  
  <p>and not in this result set:</p>
  
  <pre><code>select user_id from group_affiliations where group_id=NewId;
  </code></pre>