Oracle中查询两个指定日期(年、月、日)之间的年数、月数、日数
select empno,ename,hiredate, trunc(months_between(sysdate,hiredate)/12) year, trunc(mod(months_between(sysdate,hiredate),12)) months, trunc(sysdate-add_months(hiredate,months_between(sysdate,hiredate))) day from emp;
其中, hiredate是雇佣日期, 是过去的一个日期
sysdate是当前日期
需求:求每个员工的雇佣年、月、日