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

Home -> Community -> Usenet -> comp.databases.theory -> Re: Query on a sorted list (recursive/unary relationship)

Re: Query on a sorted list (recursive/unary relationship)

From: Alan <not.me_at_uhuh.rcn.com>
Date: Sun, 06 Jun 2004 19:06:26 GMT
Message-ID: <SWJwc.8657$321.3337@nwrdny02.gnilink.net>


Use the ORDER BY clause.

"Michael Fuchs" <fuze-YOUKNOWWHATTODOWITHTIHS-_at_gmx.net> wrote in message news:c9vnvr$41a$1_at_bird.wu-wien.ac.at...
> Hello,
>
> I need to add sorting criteria to a list stored in a database. I am
> using an additonal parentID column.
>
> |----|----------|
> | ID | ParentID |
> |----|----------|
> | 1 | NULL |
> | 2 | 1 |
> | 3 | 2 |
> | 4 | 3 |
> | 5 | 4 |
> | 6 | 5 |
> |----|----------|
>
> But how do I write the right query (SELECT) so the output is in the
> desired order? Or can this only be done programmatically. (Btw.: I have
> to use MySQL.)
>
> Thanks for any help!
>
> Michael
Received on Sun Jun 06 2004 - 14:06:26 CDT

Original text of this message

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