方法一:

SELECT TRUNC(months_between(sysdate, birth)/12) AS age from dual;

方法二:

select TRUNC((to_char(sysdate, 'yyyyMMdd') - to_char(birth, 'yyyyMMdd')) / 10000) as age from dual;

posted on 2020-06-23 12:01  江湖小虾米L  阅读(1199)  评论(0编辑  收藏  举报