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

Home -> Community -> Usenet -> c.d.o.server -> Re: %%How to <efficiently> do: SELECT MAX(Date)...WHERE Date < myParamDate

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@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 CDT

Original text of this message

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