| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: %%How to <efficiently> do: SELECT MAX(Date)...WHERE Date < myParamDate
In article <61tjpg$1ma_at_hpg30a.csc.cuhk.edu.hk>,
william_at_alumni.cuhk.edu.hk says...
> declare
> cursor cu_max_rate is
> select rating
> from rating
> order by rdate desc;
>
> max_rate number;
> begin
> open cu_max_rate;
>
> fetch cu_max_rate
> into max_rate;
>
> close cu_max_rate;
BTW, do we need to explicitly close a cursor local to a block, or is it closed automatically when it goes out of scope ?
> end;
![]() |
![]() |