mysql

案例1

用查询另一个表查出来的数据,更新表

update order_information oi
set zf_coupon_pull_state_id =  (select id from coupon_pull_state a where a.coupon_id = oi.coupon_id and a.order_num = oi.order_num) 
where oi.id >= 120742 and oi.id <= 121800 and oi.coupon_id is not null;

发表评论

电子邮件地址不会被公开。 必填项已用*标注