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 -> Re: SQL question in Connect By...

Re: SQL question in Connect By...

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Thu, 21 Jun 2001 11:36:26 +0200
Message-ID: <9gsf6r$6f3$1@s1.read.news.oleane.net>

"Diviner" <diviner_at_hknet.com> a écrit dans le message news: 3B31B9D4.143C8088_at_hknet.com...
> I want to query a record-set from a self-relationship table. The
> table stores records sound like email/newsgroup messages. It
> has thread by thread stories inside. The table structure like
> this:
> Create Table Msg(
> RefNo integer primary key,
> ParentNode integer, -- link to prior RefNo
> MsgDate Date default sysdate not null,
> Topic varchar(60) not null
> );
>
> The tree structure is totally composed by RefNo and ParentNode
> two fields. If the record is a head node in the message thread,
> ParentNode leave NULL.
>
> Now I want to list out all the message thread but don't know how
> to control the Ordering of the selected records. What I want the
> order list out is, message thread is ordered by descending MsgDate
> order, but of cause each replied message should be always follow
> by its ParentNode no matter what is its MsgDate.
>
> So how is the SQL? Thank you very much.
>
> --
> Best regards,
> Diviner.
>

Have a look at AskTom site, url:
http://asktom.oracle.com/pls/ask/f?p=4950:8:128829::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:9212348 049,{connect}

--
Have a nice day
Michel
Received on Thu Jun 21 2001 - 04:36:26 CDT

Original text of this message

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