number类型转date类型
遇到用数字记录日期时,进行查询转换。
create or replace function num_to_date(s in number) return date
is
begin
return to_date('1970-01-01 08:00:00','YYYY-MM-DD HH24:MI:SS')+(s/86400);
end;
/
select num_to_date(xxxxx) from dual;
遇到用数字记录日期时,进行查询转换。
create or replace function num_to_date(s in number) return date
is
begin
return to_date('1970-01-01 08:00:00','YYYY-MM-DD HH24:MI:SS')+(s/86400);
end;
/
select num_to_date(xxxxx) from dual;