1 create or replace function F_GETAGE(dateofbirth date) return varchar2
 2 is
 3 begin
 4     if((SYSDATE-dateofbirth)>=365) then
 5          return trunc((SYSDATE-dateofbirth)/365);
 6     else
 7          if((SYSDATE-dateofbirth)<31) then
 8               return trunc((SYSDATE-dateofbirth));
 9          else
10               return trunc((SYSDATE-dateofbirth)/30);
11          end if;
12     end if;
13 end;

 

 1 to_number((floor(MONTHS_BETWEEN(sysdate,a.dateofbirth)/12)))||'' age 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案