oracle8.1.6
select object_type,
pretty_name,
'' as indent
from acs_object_types
start with object_type = :object_type
connect by prior supertype = object_type
order by level desc
select object_type,
pretty_name,
replace(lpad(' ', (level - 1) * $indent_width), ' ', '$indent_string') as indent
from acs_object_types
start with supertype is null
connect by supertype = prior object_type
select object_type
from acs_object_types
start with object_type = :subtype
connect by prior supertype = object_type
where object_type != :substype
order by level desc