从一个表中删除与另一表相关的数据
如果删除了另一个表中的任何数据,如何删除一个表中的行。
How to delete row in one table if any data in other table is deleted.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如果删除了另一个表中的任何数据,如何删除一个表中的行。
How to delete row in one table if any data in other table is deleted.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
如果这些表有引用约束(例如外部键),则可以使用
ON DELETE
触发器If these tables have a reference constraint (such as an external key), you can use the
ON DELETE
trigger你的问题需要更详细。
尝试在您使用的任何数据库的文档中搜索“级联删除”和“引用完整性”。
Your question needs more detail.
Try searching for "cascading delete" and "referential integrity" in the documentation for whichever database you are using.
使用 ON DELETE 触发器。由于您没有说明您使用哪个数据库系统,因此您可以通过谷歌搜索正确的语法:)
Use a ON DELETE trigger. As you have not said which database system you use, it's up to you to google the right syntax :)