title: Update table A with all new entries from table B AND update existing entries in A via B
body: <p>I have a table A that contains a few columns with entries. In column 1 is an unique campaign name. Table A contains all relevant historical data.
  I have another table B that contains the same columns with entries, too. Some of the entries that are in table B can also already exist in table A (campaign name is equal with table A) but can (not must) contain diffent entries in the other columns. B is my update table with (some) new data.</p>
  
  <p>Now that what I want to do:
  I want add all new entries (rows where campaign name in Column 1 is not already in the table) completely from table B to A and update/replace the existing entries (rows where campaign name in column 1 is already in A) with the diffent entries in the other columns.</p>
  
  <p>Here´s an example:</p>
  
  <p>For example if the table A contained:</p>
  
  <pre><code>|col1                           ||col2   ||col3|
  +-----+
  |20161512_NL_Luxus_1_DE         ||Andrea ||29 |
  |20161217_LC_YoBirthdayNo_A_CH  ||Oscar  ||38 |
  |20161512_NL_SDT_4_DE           ||James  ||44 |
  |20170117_SV_YoBirthdayYes_A_DE ||Julia  ||57 | 
  </code></pre>
  
  <p>And table B contained:</p>
  
  <pre><code>|col1                           ||col2   ||col3|
  +------+
  |20161512_NL_SDT_4_DE           ||James  ||44 |
  |20170117_SV_YoBirthdayYes_A_DE ||George ||12 | 
  |20161230_LC_YoBirthdayNo_A_CH  ||Hank   ||97 | 
  |20170101_SV_YoBirthdayYes_A_DE ||Selma  ||77 | 
  </code></pre>
  
  <p>I want a query that will update Table A as following:</p>
  
  <pre><code>|col1                           ||col2   ||col3|
  +-----+
  |20161512_NL_Luxus_1_DE         ||Andrea ||29 |
  |20161217_LC_YoBirthdayNo_A_CH  ||Oscar  ||38 |
  |20161512_NL_SDT_4_DE           ||James  ||44 |
  |20170117_SV_YoBirthdayYes_A_DE ||George ||12 | 
  |20161230_LC_YoBirthdayNo_A_CH  ||Hank   ||97 | 
  |20170101_SV_YoBirthdayYes_A_DE ||Selma  ||77 |
  </code></pre>
  
  <p>That's what I've got so far:</p>
  
  <pre><code>INSERT INTO A SELECT * FROM B WHERE `col1` NOT IN (SELECT `col1` FROM `A`);
  </code></pre>
  
  <p>-> But that´s only one part of the solution...</p>
  
  <p>Unfortunately I have no idea how to solve this problem... :/ </p>
  
  <p>Thanks in advance!</p>