0
我想做以下操作刪除子查詢的MySQL更新
Delete all the records from a table called survey and then set the status of deleted reference numbers to zero(0) which is in other table
。
,我現在用的查詢低於
Update ref_numbers rn SET rn.status = 0 where ref_no IN (DELETE FROM survey WHERE id < 302)
但此查詢不工作,我也累了修改像DELETE ref_no FROM survey......
刪除查詢但它仍然不工作。我想我錯過了一些我不知道的東西。
任何幫助將不勝感激。
好吧,觸發器會被刪除後? – faisal1208
無論發生什麼事件都會導致您想要記錄的引用計數發生變化。這可能意味着在刪除後和插入後。如果還可以更改現有子記錄的父項(不尋常),則還需要AFTER UPDATE。 –