| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Extracting Parent Model from Nested Sets Model
71062.1056_at_compuserve.com (--CELKO--) wrote in message news:<c0d87ec0.0301221108.10e5d0f1_at_posting.google.com>...
> >> Does that work in SQL Server? <<
>
> No. The adjacency list model would have a (parent, child) table as a
> result. This query simply gives meaningless numbers. Yout query does
> not translate into SQL.
>
> What is the logic? Is there a looop hidden in the syntax?
The @next_brother stores the right from the last direct child, so whatever left comes right after this right is the next direct child. So you update the @next_brother to this new child and then the HAVING would filter to only those childs which have @next_brother equal to their right...
It works in mysql... But it requires you´re able to change @next_brother´s value inside the select statement...
Nuncanada Received on Wed Jan 22 2003 - 18:52:49 CST
![]() |
![]() |