Search Posts

Category: data-structures

Recursive SQL query on nested-set tree with stop condition

how to – Recursive SQL query on nested-set tree with stop condition I am using a nested-set tree structure in a table. The concept is described here. The example data looks as follow: +—-+———–+——+——-+—————–+ | id | parent_id | left | right | stop_descending | +—-+———–+——+——-+—————–+ | 1 | NULL | 1 | 10 | 0 | | 2 | 1 | 2 | 3 | 0 | | 3 | 1 | 4 | […]