Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Suggestions: Hierachical Query
mailto:skv_at_kpbank.ru
Stephan Voigt ïèøåò â ñîîáùåíèè <3538810A.1031E5FC_at_voigt-gmbh.de> ...
>Hi all,
Hi Stephan
>
>I currently use a hierachical Query with the "connect by prior" clause.
>So far everything is ok. I get a result set with parents and childs.
>
>The problem is, that the childs from each parent are unsorted. But for
>my application
>I need a sorted hierachical result set.
>
>How can I do that ?
>
1.Create index on your "sort" column:
CREATE INDEX my_index ON my_table(sort_column); 2.Create view on your table with hint INDEX: CREATE VIEW my_view AS SELECT /* INDEX (my_table my_index) */ FROM my_table; 3.Select from your view instead select from table SELECT ..... FROM my_view CONNECT BY ..... ;
Regards
Konstantin V. Sartakov Kuzbassprombank Kemerovo RussiaReceived on Sat Apr 18 1998 - 22:20:39 CDT