Home >Database >Mysql Tutorial >Oracle最大日期获取方法

Oracle最大日期获取方法

WBOY
WBOYOriginal
2016-06-07 17:55:471332browse

在开发应用中如何获取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_date := v_test(i);
END IF ;
END LOOP;
dbms_output.put_line(v_date);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line( Sqlerrm);
end;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn