一般情况下可能会直接上来这么写
update sqd_a set amount = amount * 0.1 where id in (select id from sqd_b where is_dividend = 1 and get_time < 1);
但是会直接报错 [1093] You can’t specify target table ‘sqd_a’ for update in FROM clause
正确的写法是这样的
update sqd_a as a,(select id from sqd_b where is_dividend = 1 and get_time < 1) as b set a.amount = a.amount * 0.1 where a.id = b.id;