set price = (select price from apples where variety = 'gala')
where variety = 'fuji';
错误提示是:ERROR 1093 (HY000): You can't specify target table 'apples' for update in FROM clause. MySQL手册UPDATE documentation这下面有说明 : “Currently, you cannot update a table and select from the same table in a subquery.” 在这个例子中,要解决问题也十分简单,但有时候不得不经过查询子句来update目标。好在咱们有办法。