title: SQL: Copy missing rows from one table to another based on primary key column only
body: <p>I am trying to copy missing rows from one table to another but only if the primary key field does not exist. Both tables have identical column names but I don't have the number of columns and their names and don't have the primary key column name so it could be "ID" or anything else. Let me explain with an example:</p>
  
  <p>Table 1:</p>
  
  <pre><code>   column 1 (primary key) , Column 2 , Column 3 , ...
     1 , England , London , ...
     2 , France , Paris , ...
     3, Italy , Rome , ...
     4 , Germany , Berlin , ...
  </code></pre>
  
  <p>Table 2:</p>
  
  <pre><code>    column 1 (primary key) , Column 2 , Column 3 , ...
      1 , Whatever , Whatever , ...
      2 , Whatever , Whatever , ...
  </code></pre>
  
  <p>I want to copy row 3 and 4 into table 2 so the outcome will be:</p>
  
  <p>Table 2:</p>
  
  <pre><code>    column 1 (primary key) , Column 2 , Column 3 , ...
      1 , Whatever , Whatever , ...
      2 , Whatever , Whatever , ...
      3 , Italy , Rome , ...
      4 , Germany , Berlin , ...
  </code></pre>
  
  <p>I have tried</p>
  
  <pre><code>   REPLACE INTO table1 SELECT * FROM table2; 
  </code></pre>
  
  <p>but this will replace the entire table i.e. Table 2 become exactly like Table 1</p>