Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Returning results in the order they were entered

Re: Returning results in the order they were entered

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Fri, 7 Nov 2003 14:25:44 -0000
Message-ID: <3fabab68$0$261$ed9e5944@reading.news.pipex.net>


As others have said you need to define what you mean by 'order they were entered by the user', but you seem to mean in the order that appears in the in clause... I think you are going to have real trouble with this requirement and the requirement for select distinct, especially given creative users and /or if the user can enter

124125,124122,124125,....

-- 
Niall Litchfield
Oracle DBA
Audit Commission Uk
"Boffo Jinko" <test_at_yahoo.com> wrote in message
news:boehfl$1e08bm$1_at_ID-147295.news.uni-berlin.de...

> I have a query that returns the results of a basic select statement, like
> so:
>
> select distinct id,name from Caseflow.cases where number1 in
> (124125,124122,124130);
>
> When this query is returned, it returns the results in order from lowest
to
> highest. This is typically okay, but I need to have the results returned
in
> the order they were entered by the user. So in the above example, the
> results would have to be returned at 124125,124122,124130, not
> 124122,124125,124130 as they normally would be. Is there a way to do this,
> or am I going to have to resolve this problem in my web page code? There
are
> no other fields in common that I could sort by - it has to be by the
number
> entered in the IN clause, and they are often not in any kind of order. And
> no, telling the user to enter them differently isn't an option!
>
> Thank you,
> Scott
>
>
Received on Fri Nov 07 2003 - 08:25:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US