Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: %%How to <efficiently> do: SELECT MAX(Date)...WHERE Date < myParamDate
Ken Nichols <knichols_at_mcsilo.ilo.dec.com> ÚÁÐÉÓÁÎÏ × ÓÔÁÔØÀ
<34420358.6C27_at_mcsilo.ilo.dec.com>...
> Yo Sid,
>
> The following will work:
>
> select rating from rating
> where rownum = 1
> order by rdate desc;
>
Shame on you !!!
This will NOT work.
Oracle Server will order records AFTER selecting - so
FIRST it will select ONE record which rdate field value can be arbitrary
(if you do not using INDEX )
SECOND it will order ONE record.
Dmitry, moprok_at_ropnet.ru Received on Tue Oct 14 1997 - 00:00:00 CDT
![]() |
![]() |