Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 2 张桌子(A 和 B)
假设在 A 表中我们只有 1 个项目 (id = 11) 已启用为 true,因此我将项目 id 11 视为父项目
在表 B 中,我们有项目 11 的详细信息
我想要做的是,如果项目 11 的表 B 中的名称或描述或注释发生更改,我想在单个查询中使用项目 11 的更改值更新所有项目的其余部分。
如果 project_id=11 的其他记录在同一个表中,您可以简单地运行:
Update tblB set description ='...', name ='...' where project_id = 11
如果它们在不同的表中,您可以使用触发器集在更新 tblB 时执行