title: How can I update a record the same as another record in the same table?
body: <p>I have a table like this:</p>
  
  <pre><code>// names
  +----+-------+
  | id |  name |
  +----+-------+
  | 1  | jack  |
  | 2  |       |
  +----+-------+
  </code></pre>
  
  <p>And here is the expected result:</p>
  
  <pre><code>// names
  +----+-------+
  | id |  name |
  +----+-------+
  | 1  | jack  |
  | 2  | jack  |
  +----+-------+
  </code></pre>
  
  <hr>
  
  <p>And here is my query:</p>
  
  <pre><code>update names set name = ( select name from names where id = 1 ) where id = 2
  </code></pre>
  
  <p>But it throws:</p>
  
  <blockquote>
    <p>ERROR 1093 (HY000): You can't specify target table 'names' for update in FROM clause</p>
  </blockquote>
  
  <p>How can I do that?</p>