Você pode usar
connect by
cláusula. No seu caso, o SQL pode se parecer com:
select child, parent, level
from family_tree
connect by prior parent = child
connect by
cláusula. select child, parent, level
from family_tree
connect by prior parent = child