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

Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP: recursive query

Re: HELP: recursive query

From: Alton Ayers <altona_at_ditw.com>
Date: Wed, 12 May 1999 18:28:39 -0400
Message-ID: <373A0096.43124097@ditw.com>


The following will return you what you need with the ultimate result coming first. If you are using a cursor, just fetch the first row and that's it.

SELECT level, keyfield, varname, varvalue   FROM MyTable
  START WITH varname LIKE '%PP' AND keyfield = 'ABC'   CONNECT BY PRIOR varvalue = varname
 ORDER BY level DESC
/

Hope this helps.

Alton

>
Received on Wed May 12 1999 - 17:28:39 CDT

Original text of this message

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