【问题标题】:how to delete data from multiple relative tables in ORACLEORACLE中如何从多个相关表中删除数据
【发布时间】:2018-06-24 02:49:54
【问题描述】:

我有几个表与外键有约束关系,如下所示:

  1. parent_table id(主键)
  2. parent_child c_id(primary key) and id(reference from parent_table)
  3. child ch_id(primary key) and c_id(reference from parent_child table)

现在我需要从 parent_table 中删除一条记录,包括具有相同记录的子表。但在这里我遇到的挑战是 parent_table 引用 parent_child 表,但 parent_child 表引用另一列的子表。

我如何从子表中确定确切的值以删除该特定记录。

提前致谢。

【问题讨论】:

  • 我已经完成了'on delete cascade'方法,但我的表不包含这个,并且不可能改变以包含这个。

标签: sql oracle


【解决方案1】:

关注this linkthis one 中讨论的内容,希望对您有所帮助

【讨论】:

    猜你喜欢
    • 2015-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多