Hi David
Thanks, that's nice. I haven't tried out the code yet but I seem to be getting the point we are looking from the parent in. But one problem I foresee is that I have to know if 7, 8 (via 7) and 9 (via 8, 7) belong to either 4 or 5 or 6.
Currently I have added a field containing DR or CR (this is still a fresh app so I had the liberty) to avoid this sort of query altogether and I do a replace as soon as the parent for a given node is changed.
Thanks for your help.
>
create cursor tree ( nodeno i, parentnodeno i )
>insert into tree values ( 1, 0 )
>insert into tree values ( 2, 0 )
>insert into tree values ( 3, 0 )
>insert into tree values ( 4, 1 )
>insert into tree values ( 5, 1 )
>insert into tree values ( 6, 1 )
>insert into tree values ( 7, 2 )
>insert into tree values ( 8, 7 )
>insert into tree values ( 9, 8 )
>select * ;
> from tree ;
> where tree.parentnodeno in ( select nodeno from tree where parentnodeno = 0 )
>