title: MySQL UPDATE syntax with multiple tables using WHERE clause
body: <h2>Case:</h2>
  
  <p>How to update <code>table1</code> with data from <code>table2</code> where <code>id</code> is equal?</p>
  
  <h2>Problem:</h2>
  
  <p>When I run the following update statement, it updates all the records in <code>table1</code> (even where the <code>id</code> field in <code>table1</code> does not exist in <code>table2</code>).</p>
  
  <p>How can I use the the multiple update table syntax, to update ONLY the records in <code>table1</code> ONLY where the <code>id</code> is present in <code>table2</code> and equal?</p>
  
  <pre><code>UPDATE table1,table2
  SET table1.value=table2.value 
  WHERE table2.id=table1.id
  </code></pre>
  
  <p>Thanks in advance.</p>