mysql中子查询更新,得用别名表

通过查出最大id,来更新记录

update order set status = 'xx' where id in (select v.id from
(select max(id) id from x_order where device_id='000000' and uid=1)v)

原文地址:https://www.cnblogs.com/jiduoduo/p/6400538.html