Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Hierarchical Query
Fei Sha wrote:
> Hi, everybody,
>
> I want to do something with hierarchical query, but I don't know
> how to. And I wonder whether it is possible after all.
>
> Here is a table:
>
> TABLE T
> --------------------------------
> parent_id name child_id
> --------------------------------
> 1 A 2
> 2 B 3
> 3 C 4
> 4 D 5
> ...
> --------------------------------
>
> I want a query to return the trace of the hierarchy.
>
> i.e. A.B.C.D
>
I apologize. I don't think I have made the question clear. In fact, each row can have several descendants, so the result usually has a tree structure:
A.B1.C1.D1 A.B1.C1.D2 A.B1.C2.D3 ....Received on Sun Jan 24 1999 - 16:34:49 CST