Oracle最大日期获取方法

在开发应用中如何获取oracle的最大日期呢?本文将提供这样一个获取方法,需要的朋友可以参考下

sql代码


复制代码 代码如下:

— created on 2010/06/08 by nan

declare

— local variables here

type t_test is table of date index by binary_integer;

v_test t_test;

v_date date;

begin

— test statements here

v_test(1) := ‘20020202’;

v_test(2) := ‘20090202’;

v_test(3) := ‘20100202’;

for i in 1 ..v_test.count loop

if v_date is null then

v_date := v_test( 1);

end if ;

if v_date < v_test(i) then

v_date := v_test(i);

end if ;

end loop;

dbms_output.put_line(v_date);

exception

when others then

dbms_output.put_line( sqlerrm);

end;

(0)
上一篇 2022年3月22日
下一篇 2022年3月22日

相关推荐