I have a table that has a tree of state, region, district, building and classes. Each row has a node id and a parent id. I am using the following
select name, child node, parent id from tableA
connect by prior child node = parent id
i get:
CA
CENTRAL REGION
FRESNO DISTRICT
ST Jim BUILDING
ST joe BUILDING
st tom BUILDING
st sue BUILDING
JIMS CLASS
JOES CLASS
TOM CLASS
SUE CLASS
Problem is that at building level all buildings are listed one after another and then all the classes one after another. However I want to list the building and the class it is a parent of then the next building as follows
FRESNO DISTRICT
st jim building
jims class
st joes building
joes class...
the node id and parent id are correct it just that all children are listed for a parent then all children for that child. it is not showing which child goes with the parent.
I want to show the tree from the top down such as CA, Central region, Fresno district, St Joe Building, Ms Mary class, Ms