我想要做的是当我的父母状态为“已删除”时更新我的子表
父母表
-------------
PID | CID |Pstatus
1 | 1 | Deleted
2 | 1 | Active
3 | 2 | Deleted
4 | 2 | Deleted
背后的逻辑如下
IF CID = 1 and PsTatus = deleted
Update ChildTableStatus
Set Status = 'Deleted'
Where CID = 1
Else
cannot update childtablestatus to deleted due to there are active records
如何在这里执行循环检查?