title: Using INSERT INTO SELECT when table structures do not match in MySQL
body: <p>I'm familiar with the following use of the command:</p>
  
  <pre><code>INSERT INTO mytable 
  SELECT * 
    FROM other_table 
  </code></pre>
  
  <p>This works fine when the tables are identical in terms of layout.</p>
  
  <p>What I'd like to do is something like:</p>
  
  <pre><code>INSERT INTO mytable 
  SELECT * 
    FROM other_table ON DUPLICATE KEY UPDATE
  </code></pre>
  
  <p>This fails with a syntax error:</p>
  
  <blockquote>
    <p>MySQL Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ON QUERY INSERT INTO mytable SELECT * FROM other_table ON DUPLICATE KEY UPDATE  </p>
  </blockquote>
  
  <p>I can't find any docs that describe this.</p>