Re: %%How to <efficiently> do: SELECT MAX(Date)...WHERE Date < myParamDate

From: Dmitry Ivanoff <moprok_at_ropnet.ru>
Date: 1997/10/14
Message-ID: <01bcd877$90485aa0$0200a8c0_at_DmitryIv.moprok.ropnet.ru>#1/1


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 CEST

Original text of this message