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: Ordering select results without ORDER BY

Re: Ordering select results without ORDER BY

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Tue, 11 Dec 2001 17:58:17 GMT
Message-ID: <ZOrR7.8053$7y.71121@rwcrnsc54>


You could but it into an IOT where check_no is the key, but I would fix the query. Otherwise no.
Jim
"Ted O'Connor" <google_at_toconnor.com> wrote in message news:4b29c484.0112110623.16b40104_at_posting.google.com...
> I have some vendor code that I am supporting that has some incorrect
> SQL. Currently it is trying to get the lowest available check number
> from a checks table using the following SQL:
>
> select * from checks
> where rownum = 1 and check_status = 'A'
> order by check_no
>
> I know this returns the wrong number since the rownum is being applied
> before the order by. I have fixed the SQL but cannot apply the code
> change for two weeks because of a server migration. In the meantime
> is there any way I can order the checks table physically by check_no
> (not currently a key or index) so the above SQL will return the
> correct result?
>
> Thanks.
Received on Tue Dec 11 2001 - 11:58:17 CST

Original text of this message

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