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