Hi Robert;
The math actually works either way; if it goes negative, the offset is
positive, which is okay. Your selects are way more elegant. I guess I
was just raising the point that using a key other than lft (which tends
to move around in an active tree), is probably safer. The table lock
I think you should take a closer look at Greg's function. It is uses
lfts as parameters in the function mainly just to make the function
implementation independent; I was able to easily adapt it to my schema
which uses unique id's for each object in the tree hierarchy.
After looking your function