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

Home -> Community -> Usenet -> c.d.o.tools -> Connect By query question

Connect By query question

From: Sean Dolan <nospam_at_nowhere.com>
Date: Thu, 17 May 2001 10:25:56 -0600
Message-ID: <9e0u2h02n2v@enews2.newsguy.com>

Oracle 8.1.7:

My current query and results:

    select LPAD(' ', 2*(level-1), '-') || display CategoryDisplay, cat_id

       from category
       start with cat_id = 50000095
       connect by prior cat_id = parent_cat_id;

Results:



SALES DEPT 50000095
- Inside Sales 50000117

--- Product 50000119
----- monitors 50000503
----- printers 50000502
----- computers 50000504
----- Keyboards 50000505

--- Service 50000120
- Outside Sales 50000118

--- Product 50000121

GOAL : I am trying to alphabetize each level of the tree so that it would come out looking like:

SALES DEPT 50000095

- Computer sales 50000461
- Inside Sales 50000117

--- Product 50000119
----- computers 50000504
----- Keyboards 50000505
----- monitors 50000503
----- printers 50000502

--- Service 50000120
- Outside Sales 50000118

--- Product 50000121

Question : How do you order just the level within the tree ????

Thanks,
Sean Dolan Received on Thu May 17 2001 - 11:25:56 CDT

Original text of this message

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