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: Suggestions: Hierachical Query

Re: Suggestions: Hierachical Query

From: skv <skv_at_kpbank.ru>
Date: Sun, 19 Apr 1998 11:20:39 +0800
Message-ID: <6hbqba$9lm$1@home.kpbank.ru>

           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 ..... ;

>If I add order by to the statement, the hierachical stucture is
>destroyed.
>I have not found any way to manage this.
>
>Please help !
>
>

Regards


         Konstantin V. Sartakov
                Kuzbassprombank
                       Kemerovo
                         Russia



Received on Sat Apr 18 1998 - 22:20:39 CDT

Original text of this message

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