Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Ordering select results without ORDER BY
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 - 08:23:20 CST
![]() |
![]() |