在执行update语句是遇到:You can’t specify target table ‘backup’ for update in FROM clause
update `backup` set file_size = 1.11 where backup_time =
select max(backup_time) backup_time
from `backup`
where task_id = 1)
不能在from字句中使用要update的表。
此时我们可以用一个起别名的中间表
update `backup` set file_size = 1.25 where backup_time =
(select b.backup_time
from
(select max(backup_time) backup_time
from `backup`
where task_id = 1) b )