Answer the question
In order to leave comments, you need to log in
How to store a tree?
There is a task - to store hierarchy of types in a DB.
The classification of types is always changing - elements can be added at any level, the levels themselves can change. In general, anything can happen.
I remembered how we stored trees at the university - we numbered the left and right vertices of the element, I don’t remember exactly what it is called, as shown in the figure .
The question is how to update this, after adding each element you will have to recalculate all the vertices, is there a native function for this in Oracle?
How to get the immediate children or all children (although the children are easy to get - the value of the left vertex of the child between the left and right of the parent) ?
Who is in the subject, tell me.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question