| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Query on a sorted list (recursive/unary relationship)
Alan wrote:
> Use the ORDER BY clause.
OK, but ORDER BY what?
ORDER BY ParentID gives _not_ the korrekt order.
|----|----------|
| ID | ParentID |
|----|----------|
| 1 | NULL |
| 2 | 1 |
| 3 | 2 |
| 4 | 3 |
| 5 | 4 |
| 6 | 5 |
|----|----------| now I want switch the IDs 3 and 4 |----|----------|
| ID | ParentID |
|----|----------|
| 1 | NULL |
| 2 | 1 |
| 4 | 2 |
| 3 | 4 |
| 5 | 3 |
| 6 | 5 |
|----|----------|
This now is the order I want to get. Looking at the two colums makes it obvious that I can not use the ORDER BY clause on them.
I guess there is no way other than programming the right order in the application.
Thank you,
Michael
Received on Sun Jun 06 2004 - 14:24:16 CDT
![]() |
![]() |