List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:August 25 2000 8:18pm
Subject:Re: generating a table of sequenced records without a index
View as plain text  
In the last episode (Aug 25), ctest@stripped said:
> another option would be to create a integer field called
> "part_number" in the table.
> 
> part_number   part
> ------------------
> 1             "head"
> 2             "neck"
> 3             "tail"
> 
> this preseves the information, but still denies us the ability to add
> something between "neck" and "tail", since there are no integers
> between neck and tail.  If we make "part_number" a float, it allows
> us to spec intermediate values (i.e. insert a record VALUES ( 2.3,
> "vertibrae 37")), but still feels non-ideal.  Is there a direct way
> to create a non-indexed order to records in a table?

You could also create a linked-list type setup:

part_number   next_part   name
------------------------------
1             2           Head
2             3           Neck
3             NULL        Tail

then either pull all the records into your app and walk the list, or do
individual queries each time you need the next part in the chain. 
Either way, you don't be able to get at your preferred result in one
query.  It is possible under Oracle, though, where you could use the
START WITH ... CONNECT BY syntax to handle the link lookup.


-- 
	Dan Nelson
	dnelson@stripped
Thread
generating a table of sequenced records without a indexctest25 Aug
  • Re: generating a table of sequenced records without a indexGerald L. Clark25 Aug
  • Re: generating a table of sequenced records without a indexRobert Galarneau25 Aug
    • Re: generating a table of sequenced records without a indexctest25 Aug
  • Re: generating a table of sequenced records without a indexDan Nelson25 Aug
    • Re: generating a table of sequenced records without a indexctest25 Aug
      • Re: generating a table of sequenced records without a indexDan Nelson25 Aug
  • Re: generating a table of sequenced records without a indexKevin D25 Aug
RE: generating a table of sequenced records without a indexChris Mulcahy25 Aug
  • Re: generating a table of sequenced records without a indexctest25 Aug