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: SQL to connect by and order by at the same time

Re: SQL to connect by and order by at the same time

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Thu, 29 Nov 2001 18:40:16 -0000
Message-ID: <9u5vjh$1ka$1@news7.svr.pol.co.uk>

http://www.jlcomp.demon.co.uk/faq/connectby.html

hth
connor

"Clayton Nash" <clayton_at_ionicom.co.uk> wrote in message news:3c063687.342921184_at_news.easynet.co.uk...
> Hi,
>
> I have a hierarchial set of data in a table which I'm retrieving with
> a connect by query -- something like
>
> SELECT LEVEL, component_id, title FROM COMPONENT_DATA
> START WITH component_id = 1
> CONNECT BY PRIOR component_id = parent_component_id;
>
> The issue I have is that I'd like to have teh list sorted by title as
> well. If I do
> SELECT LEVEL, component_id, title FROM COMPONENT_DATA
> START WITH component_id = 1
> CONNECT BY PRIOR component_id = parent_component_id
> ORDER BY title;
>
> Then the list is sorted _after_ the hierarchial connect. This
> obviously isn't what I want -- I want the sorts to take place within
> each branch.
>
> Is there any easy way to do this?
>
> Thanks,
>
> Clayton
> PS: Oracle 8.1.5 -- query is in a PL/SQL procedure -- Linux 6.2
Received on Thu Nov 29 2001 - 12:40:16 CST

Original text of this message

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