Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Chapter 4: Nested Sets Model of Hierarch... > 4.3 Finding Levels and Paths in a Tr... - Pg. 67

54 CHAPTER 4: NESTED SETS MODEL OF HIERARCHIES This would tell you that everyone is also his own superior, so in some situations you would also add the predicate .. AND Workers.lft < > Mgrs.lft or change it to WHERE Workers.lft > Mgrs.lft AND Workers.lft < Mgrs.rgt; This simple self-join query is the basis for almost everything that follows in the nested sets model. 4.3 Finding Levels and Paths in a Tree The level of a node in a tree is the number of edges between the node and the root, where the larger the depth number, the farther away the node is from the root. A path is a set of edges that connect two nodes directly.