方法一:利用months_between 函数计算
SELECT TRUNC(months_between(sysdate, birthday)/12) AS age
from dual;
方法二:日期转换为 'yyyyMMdd' 格式后,相差一年的两个日期差为:10000
select TRUNC((to_char(sysdate, 'yyyyMMdd') - to_char(birth, 'yyyyMMdd')) /
10000) as age
from mytable