Delete a child and a parent row with one SQL script

前端 未结 7 665
执念已碎
执念已碎 2021-01-04 00:30

Instead of deleting the child row and then writing another sql statement to delete the parent row I wanted to use one statement which will do both. FYI: we use Oracle databa

7条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-04 00:32

    Define your foreign keys with cascading deletes. Then you only need to delete the "parent" row.

提交回复
热议问题