MySQL查询更新所有满足条件的数据


-- 将订单表所有的状态改成1
update oc_repair_preorder a inner join (select id,`status` from oc_repair_preorder) b on a.id = b.id set a.`status` = 1

 

 

 

update oc_repair_order a right join (select id,`status` from oc_repair_order where del=0 and task_id=1 and accept_user_id=666 and `status` in (1,2,3)) b on a.id = b.id set a.`status` = 2


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM