Re: SQL help requested - "linked list"

From: Bob Badour <bbadour_at_golden.net>
Date: Thu, 21 Aug 2003 18:11:44 -0400
Message-ID: <dzc1b.250$m25.56267904_at_mantis.golden.net>


"Mia" <nospam_at_cox.net> wrote in message news:3F4540C5.4050201_at_cox.net...
> Thanks Bob,
>
> In my mind I was thinking one thing but I did not state it very well. I
> want to select not just the immediate previous and next IDs, but all the
> ID's - the previous to the previous and the next of the next, and so on,
> all the way to the ends of the list.

In that case, the answer will depend on the dbms you are using. In general, SQL does not support recursive queries; although, many products do.

I assume you cannot guarantee (nextid > id) for all rows in each table. I suggest you consider a solution that directly models order using ordered values instead of recreating physical order logically. Received on Fri Aug 22 2003 - 00:11:44 CEST

Original text of this message