Subject Tree as adjaceny List conversion to nested set.
Author Jem Rayfield

I have a tree structure stored as an adjacency list

create table tree (
id integer,
pid integer,
name varchar( 10 )

I want to convert this Tree into a nested set using the following
data structure.

create table nested_set (
name varchar( 10 ),
left integer,
right integer

Has anyone got a URL/example stored-procedure for this type of

Thanks for any pointers.

Jem Rayfield
Technical Consultant
Deutsche Bank [/]
CIB - IT Infrastructure
Corporate and Investment Bank (CIB)
t: +44(20)754-51943


This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.