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: Noons <wizofoz2k_at_yahoo.com.au>
Date: 19 Aug 2003 23:42:39 -0700
Message-ID: <73e20c6c.0308192242.2fe3f007@posting.google.com>


ronnie_yours_at_yahoo.com (Ronnie) wrote in message news:<ea603f8d.0308191244.a771d15_at_posting.google.com>...
> Please suggest

How's this:

SQL> desc zot

 Name                           Null?    Type
 ------------------------------ -------- ------------------------
 F1                                      VARCHAR2(1)
 F2                                      VARCHAR2(1)
 F3                                      DATE

SQL> select * from zot
  2 ;
Press Return to continue...

F F F3

- - --------------------
a b 2003-Aug-20 16:11:13
b c 2003-Aug-20 16:11:22
c d 2003-Aug-20 16:11:32

e f 2003-Aug-20 16:11:46
f g 2003-Aug-20 16:12:29

Elapsed: 00:00:00.50
SQL> select
  2 nvl((select 'Y' from dual where exists

  3      (select 1 from zot
  4       where f2 = 'd'
  5       connect by prior f2 = f1
  6       start with f1 = 'a')),'N')

  7 from dual;
Press Return to continue...

N
-
Y

Elapsed: 00:00:00.18
SQL> select
  2 nvl((select 'Y' from dual where exists

  3      (select 1 from zot
  4       where f2 = 'd'
  5       connect by prior f2 = f1
  6       start with f1 = 'e')),'N')

  7 from dual;
Press Return to continue...

N
-
N

Elapsed: 00:00:00.28

HTH
Cheers
Nuno Souto
wizofoz2k_at_yahoo.com.au.nospam Received on Wed Aug 20 2003 - 01:42:39 CDT

Original text of this message

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