title: Mysql compare two tables and display only the difference
body: <p>I would like to find the difference between two tables, because there is a column in table 2 which was linked to the table 1 ID column but sadly a site manager deleted items from table 1 and now there are a lots of unlinked rows in table 2 what causes problems on the site.</p>
  
  <p>For example here are the table structures</p>
  
  <pre><code>Table 1          table 2
  
  ID | name      ID | value (this is the ID from table 1) 
  1  | one       1  | 1
  2  | two       2  | 2
  3  | three     3  | 4
  6  | six       4  | 4
  7  | seven     5  | 5
                 6  | 5
                 7  | 6
                 8  | 7
                 9  | 1
                 10 | 1
  </code></pre>
  
  <p>As you see in table 2 some IDs from table 1 are in multiple rows and I would like to get all of them which aren't present in table 1 as the return of the query.</p>
  
  <p>Just for clarification this is what I would like to get from the query</p>
  
  <p>Result:</p>
  
  <pre><code>ID (form table 2) | value
   3                | 4
   4                | 4
   5                | 5
   6                | 5
  </code></pre>
  
  <p>I know I could use for example NOT IN but than I would have to put in about a 1000 IDs and table 1 contains much more items than what is linked in table 2</p>
  
  <p>How can I do a query which will return a result like above?</p>