I have the following hierarchical structure: Here is the closure table I’ve come up with: I want to remove the link between B and D, and therefore I want to delete the link between A and D (the one of depth 2). The problem is that I don’t want to delete the link between A and D of depth 3