Re: Self join - multiple rows in result.

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Joe Celko (jcelko212_at_earthlink.net)
Date: 06/18/04


Date: Thu, 17 Jun 2004 19:00:30 -0700

You ned to look at the nested sets model instead of this adjacency list
model for a tree. Here is the link on Amazon.com for my new book on
"Trees & Hierarchies in SQL"

http://www.amazon.com/exec/obidos/tg/detail/-/1558609202/qid=1080772873/
sr=1-1/ref=sr_1_1/102-7683601-6345721?v=glance&s=books#product-details

--CELKO--
 ===========================
 Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: help with nested set
    ... lft INTEGER NOT NULL UNIQUE CHECK, ... rgt INTEGER NOT NULL UNIQUE CHECK, ... There are many ways to represent a tree or hierarchy in SQL. ... To convert the graph into a nested sets model think of a little worm ...
    (comp.databases.theory)
  • Generating binary and ternary trees in teh neste4d sets model
    ... There are many ways to represent a tree or hierarchy in SQL. ... define a simple OrgChart table like this. ... Is there a simple way to generate a nested sets model of a complete ...
    (comp.databases.theory)
  • Re: Reflexive table problem - tricky
    ... > can be done in a VIEW with the nested sets model. ... > FROM OrgChart AS E ... > tree as an indented listing. ... > constraints, Declarative Referential Integrity, datatypes, etc. in your ...
    (microsoft.public.sqlserver.programming)
  • Re: Nested Sets and custom sorting
    ... just insert the nodes into the tree in whatever order you'd like to ... into the menu-table in Joe Celko's nested sets model looks like: ... the node with the lowest id is inserted first ... value of the ListOrder and SortIndex fields of a node. ...
    (microsoft.public.sqlserver.programming)
  • Re: Data Model
    ... And I didn't offer a schema that would ... show how the data appears when viewed in the db's grid and tree views. ... The grid view below only shows instances of person. ... In essence, the tree nodes display ...
    (comp.databases.theory)