mysql不支持:update table_a set column=select column from table_b类似的子查询
但是可以通过以下方式执行:
update table_a a inner join (select sid,updatetime from table_b b where b.sid in (1,2,3,4)) c on a.id=b.id set a.column = c.column,a.status=11 where a.id in (1,2,3,4));
解释:更新时,将更新所需的子查询查询出来命名为c表名和所需要更新的a进行关联,update 就和以上类似了