MySQL查询更新所有满足条件的数据
生活随笔
收集整理的這篇文章主要介紹了
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
轉載于:https://www.cnblogs.com/Soy-technology/p/11059603.html
總結
以上是生活随笔為你收集整理的MySQL查询更新所有满足条件的数据的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: R语言 删除空行
- 下一篇: Python-----学了今天,忘了昨天