Parent Child
---------------------------------- ----------------------------------
World Europe
World North America
Europe France
France Paris
North America United States
North America Canada
United States New York
United States Washington
New York New York City
Washington Redmond
----------------------------------------------
如何实现下边的查询结果:::????World
North America
Canada
United States
Washington
Redmond
New York
New York City
Europe
France
Paris
select lpad(Parent,length(Parent)+level) col from tbname connect by prior child=parent;
start with parent is not null
connect by child=prior parent;
FROM dbname
START WITH Parent IS 'World'
CONNECT BY PRIOR Child= Parent ;
FROM dbname
START WITH Parent = 'World'
CONNECT BY PRIOR Child= Parent ;