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