I'm trying to implement set model of trees in SQL and I found a problem:
How to find first level children of parent?
For this structure (with left and right set values):
1 Jerry 10
|
-------------------
| |
2 Bert 3 4 Chuck 9
|
------------
| |
5 Donna 6 7 Fred 8
The question is: Who is first level child of Jerry?
The answer should produce:
Bert
Chuck
BarTeo