I\'ve been using the crap out of the Nested Set Model lately. I have enjoyed designing queries for just about every useful operation and view. One thing I\'m stuck on is how
i know im doing a necro post, but here's my opinion.
why not include a "depth" column in your nested set? the depth column will indicate the "level" of an item.
so, to select the immediate childs of an item, just do
select c.*
from tree as p
join tree as c on (c.left > p.left and c.right < p.right and c.depth = p.dept + 1)
where p.id = @parentID