Path: news.easynews.com!core-easynews!newsfeed3.easynews.com!easynews.com!easynews!news.glorb.com!newsfeed.utanet.at!newsfeed.wu-wien.ac.at!not-for-mail
From: Michael Fuchs <fuze-YOUKNOWWHATTODOWITHTIHS-@gmx.net>
Newsgroups: comp.databases.theory
Subject: Re: Query on a sorted list (recursive/unary relationship)
Date: Sun, 06 Jun 2004 21:57:46 +0200
Organization: University of Economics and Business Administration, Vienna, Austria
Lines: 19
Message-ID: <c9vsj6$49r$1@bird.wu-wien.ac.at>
References: <c9vnvr$41a$1@bird.wu-wien.ac.at> <SWJwc.8657$321.3337@nwrdny02.gnilink.net> <c9vqkc$467$1@bird.wu-wien.ac.at> <mcKwc.11385$QT3.4387@nwrdny01.gnilink.net>
NNTP-Posting-Host: m771p029.adsl.highway.telekom.at
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: bird.wu-wien.ac.at 1086551462 4411 62.47.128.93 (6 Jun 2004 19:51:02 GMT)
X-Complaints-To: abuse@wu-wien.ac.at
NNTP-Posting-Date: Sun, 6 Jun 2004 19:51:02 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113
X-Accept-Language: de-at, de-de, en-us, en
In-Reply-To: <mcKwc.11385$QT3.4387@nwrdny01.gnilink.net>
Xref: core-easynews comp.databases.theory:35751
X-Received-Date: Sun, 06 Jun 2004 12:50:24 MST (news.easynews.com)

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
