title: How do you merge two tables with multiple unique indentifiers?
body: <p>Hey I have two tables with the same rows the first table is the main table and I want to upsert the data with new unique entries from the <code>_tmp_</code> table.</p>
  <p>for example;</p>
  <p><code>id, text_id, last_sent, recent_sent, updated_at, date_created</code></p>
  <p>I want to merge a communicated <code>_tmp_</code> table that is created from another table into the communicated table. Only if the communicated table doesn't have an identical row id, text_id, last_sent and recent_sent</p>
  <p>The query I'm using now is posted below but doesn't work. This query inserts all the data from the <code>_tmp_</code> table.</p>
  <p>I have checked and both the types of the tables are the same. And I just don't know what I'm doing wrong.</p>
  <p>Help much appreciated</p>
  <pre><code>MERGE
    `project.map.communicated` CURRENT_TABLE
  USING
    `project.map.communicated_tmp_` NEW_OR_UPDATED
  ON
    (CURRENT_TABLE.id = NEW_OR_UPDATED.id
      AND CURRENT_TABLE.text_id = NEW_OR_UPDATED.text_id
      AND CURRENT_TABLE.last_sent = NEW_OR_UPDATED.last_sent
      AND CURRENT_TABLE.recent_sent = NEW_OR_UPDATED.recent_sent)
    WHEN NOT MATCHED
    THEN
  INSERT
    (`id`,
      `text_id`,
      `last_sent`,
      `recent_sent`,
      `updated_at`,
      `date_created`)
  VALUES
    (`id`,`text_id`,`last_sent`,`recent_sent`,`updated_at`,`date_created`)
  </code></pre>