Re: Nested set model with large gaps and spreads in the numbering

From: John Gilson <jag_at_acm.org>
Date: Wed, 18 Sep 2002 07:45:15 GMT
Message-ID: <faWh9.2162$GJ3.405016_at_twister.nyc.rr.com>


"--CELKO--" <71062.1056_at_compuserve.com> wrote in message news:c0d87ec0.0209170547.116289a_at_posting.google.com...
> >> Below is some T-SQL code, tested on SQL Server, that implements
> this followed by a few examples. The code might appear a bit complex
> on a first pass but the algorithm is straightforward. Note that while
> iteration is used, no temp tables or extra columns are required. <<
>
> I am out of town today, but I will play with this when I get back.
> Looks like a lot of the same stuff that Richard Romley got, but he
> used recursion in a UDF instead of iteration to get the results.

I posted a slightly simplified version of my previous algorithm. Both should give you the same results but the latter is cleaner and, hopefully, clearer.

Regards,
jag Received on Wed Sep 18 2002 - 09:45:15 CEST

Original text of this message