Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Connect by prior sorts incorrectly
Other reply posting have answered the why. Here may be a fix.
I can not test this from home, but I think this will work.
Try this version of your query to restore the desired order. It keeps the connect by order information from the nested query, to use to order the main join query.
HTH MARK
ROWNUM hierarchy_order
FROM or_organization
START WITH or_trigram = my_or_trigram
CONNECT BY PRIOR or_trigram = or_parent) org,
reop_orgpersp op,
rr_remember rr
WHERE org.or_trigram=rr.or_trigram
AND (rr.re_year*100)+rr.re_period=(
SELECT MAX((rrx.re_year*100)+rrx.re_period)
FROM rr_remember rrx
WHERE rrx.or_trigram=org.or_trigram)
AND op.re_id=rr.rr_id
AND op.pe_name=my_pe_name
ORDER BY org.hierarchy_order
;
>.....
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Sat Mar 13 1999 - 00:24:46 CST
![]() |
![]() |