| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Query on a sorted list (recursive/unary relationship)
Google on "celko nested sets".
"Michael Fuchs" <fuze-YOUKNOWWHATTODOWITHTIHS-_at_gmx.net> wrote in message
news:c9vsj6$49r$1_at_bird.wu-wien.ac.at...
> Alan wrote:
> > I don't know. You never mentioned what you wanted to sort by, and I am
still
> > not sure looking at your description. Note that you cannot order by the
way
> > the data is stored in the table. It is a set, and by definition is not
> > ordered.
>
> I agree on what you say. As there is no 'natural' order, I introduced an
> artificial one. It is designed as a recursive relationship. The ParentID
> only stores the information on what node is superior.
>
> The question is not as simple as on what colum I should use the ORDER BY
> clause.
>
> I think I remember something like START WITH - CONNECT BY on Oracle
> which might do the trick. (Unfortunately I do not have Oracle but
> MySQL.) So are there any standard SQL workarounds for this?
>
> Thanks,
> Michael
Received on Sun Jun 06 2004 - 20:09:56 CDT
![]() |
![]() |