showing a sub hierachy in a main hierarchy query using connect by prior
Posted on 2007-03-25
here is a hierarchy in oracle
SELECT LPAD(' ',2*(LEVEL-1)) || TO_CHAR(location) s
START WITH location ='12000'
CONNECT BY PRIOR location = parent;
AS you see the table is called location,my asset table also has its own hierarchy,but in affect has a relation to the location table location.location =asset.location,below is its own hierarchy
SELECT LPAD(' ',2*(LEVEL-1)) || TO_CHAR(ASSETNUM) s
START WITH assetnum ='AGV314'
CONNECT BY PRIOR assetnum = parent;
how do i join both selects?to show all locations as all its assets in one hierarchical query?
all help will do