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