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 -> Re: Question on Hierarchy

Re: Question on Hierarchy

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 20 Aug 2003 07:42:55 GMT
Message-ID: <bhv8pv$3hu5m$1@ID-82536.news.uni-berlin.de>

> 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.

Ron

Maybe, the following link helps on that
http://www.adp-gmbh.ch/ora/sql/connect_by.html#is_parent

Rene

-- 
  Rene Nyffenegger
  www.adp-gmbh.ch
Received on Wed Aug 20 2003 - 02:42:55 CDT

Original text of this message

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