| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Query on a sorted list (recursive/unary relationship)
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
![]() |
![]() |