title: mysql - updating rows between tables
body: <p>I have two tables with identical structure.</p>
  
  <p>old_table looks something (example, not actual table) like this:</p>
  
  <pre><code>Name  -  DOB  - id
  John  -  xxxx - 344
  </code></pre>
  
  <p>new_table looks like this:</p>
  
  <pre><code>Name  - DOB  - id
  John  - 1980 - 344
  </code></pre>
  
  <p>Where the new_table has the DOB column filled in. The ID field (unique) and the rest of the structure is the same between tables. I want to update the DOB fields in the old_table with the values from the new_table where the ID fields are the same (so in the above example where the 'id'=344, etc, for all rows and ids).</p>
  
  <p>I was thinking of using:
  INSERT INTO old_table (DOB) SELECT DOB FROM new_table WHERE...</p>
  
  <p>but then my mysql knowledge trails off. Should I even be using INSERT or can I use UPDATE here? And how do I only pull the DOB value from the old_table where the ID field = the ID field of the new_table?</p>
  
  <p>Thanks..</p>