title: MySQL - Update values based on subquery
body: <p>let's say I have select, which return me from table1:</p>
  
  <pre><code>ID  Name
   1  Bob
   2  Alice
   3  Joe
  </code></pre>
  
  <p>Then I want UPDATE values in another table based on this result:</p>
  
  <pre><code>UPDATE table2 SET Name = table1.Name WHERE ID = table1.ID
  </code></pre>
  
  <p>As I understood, I can only do internal select in one place, like:</p>
  
  <pre><code>UPDATE table2 SET Name = (select Name from table1) WHERE ...
  </code></pre>
  
  <p>And I don't know how to specify WHERE-condition.</p>