Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Question on Hierarchy

Question on Hierarchy

From: Ronnie <ronnie_yours_at_yahoo.com>
Date: 19 Aug 2003 13:44:56 -0700
Message-ID: <ea603f8d.0308191244.a771d15@posting.google.com>


Hi,

I have a table which has data on father and sons

SQL> desc father_sons
Name Null? Type

----------------------------------------- -------- ------------
FATHER VARCHAR2(1)
SON VARCHAR2(1) The data in the table looks something like this

SQL> select * from father_sons;

F S
- -
a b
b c
c d

where b is the son of a
c is the son of b
d is the son of c

Lets say I were given "a" and "d" and asked to find out whether they are related or not. In this case they are.

How do i write a query which just gives me true or false on whether they are related or not.

Please suggest

Thanks
Ron Received on Tue Aug 19 2003 - 15:44:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US