Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP: recursive query
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