在Oracle SQL中计算特定年份的年龄

Please i need help about oracle sql! I try to get age from birth date but it's not working from the year 1940 ! My query is
select months_between(sysdate, '11/01/40') from dual; and the answer i get is -19! The calculation works up to year 1950

评论
dab
dab

如果您使用带有全年内容的正确的ANSI日期文字,它将起作用:

SELECT MONTHS_BETWEEN(sysdate, date '1940-01-11') FROM dual;
点赞
评论