Path: news.easynews.com!easynews!crtntx1-snh1.gtei.net!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!btnet-peer0!btnet!ctb-nntp1.saix.net!not-for-mail
From: "Billy Verreynne" <vslabs@onwe.co.za>
Newsgroups: comp.databases.oracle.server
Subject: Re: select order by my_outside_order
Date: Thu, 8 Aug 2002 09:25:01 +0200
Organization: Verreynne Software Labs
Lines: 42
Message-ID: <ait6ce$849$1@ctb-nnrp2.saix.net>
References: <f44c6b66.0208070430.6e7315f1@posting.google.com>
NNTP-Posting-Host: 198.54.202.209
X-Trace: ctb-nnrp2.saix.net 1028791502 8329 198.54.202.209 (8 Aug 2002 07:25:02 GMT)
X-Complaints-To: abuse@saix.net
NNTP-Posting-Date: 8 Aug 2002 07:25:02 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Xref: easynews comp.databases.oracle.server:157233
X-Received-Date: Thu, 08 Aug 2002 00:22:08 MST (news.easynews.com)

"Aviv" <ronensh@hotmail.com> wrote

> I want the query to return the records in the order of appearance at
> the vector,

If I understand correctly...

Problem. ID is numeric but not sequential and thus can not be ordered by.
Select must return the ID's in the correct vector sequence.

Solution. The vector table needs to have a sequential numbering sequence to
number the ID's into the correct sequence for a vector.

E.g.
SELECT seq, id FROM vector ORDER BY seq

SEQ    ID
-----  ----
1      99
2      98
3      97
4      96
5      95
6      94
7      93
8      92
9      91
10     90

I can not see how you can do it any other way. If Codd's basic design rules
have been followed, then the need for this sequence would have been clearly
identified.

The bottom line is that you can only order by data that is there - and if
you do not know the sequence of the ID's in a vector, there is no way in
hell that Oracle can magically know what the order should be.

--
Billy



