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

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

Query on a sorted list (recursive/unary relationship)

From: Michael Fuchs <fuze-YOUKNOWWHATTODOWITHTIHS-_at_gmx.net>
Date: Sun, 06 Jun 2004 20:39:10 +0200
Message-ID: <c9vnvr$41a$1@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 - 13:39:10 CDT

Original text of this message

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