Oracle 找出雇佣日期到现在为止有18年的员工
来源:百度知道 编辑:UC知道 时间:2024/05/26 11:29:18
找出雇佣日期到现在为止有18年的员工
10select ename from emp where MONTHS_BETWEEN(sysdate,hiredate)/12>18;
months有s
10select ename from emp where MONTHS_BETWEEN(sysdate,hiredate)/12>18;
months有s
这sql有问题吗?
只有就是MONTHS_BETWEEN(sysdate,hiredate)/12得到的是float类型的数据,你可以使用四舍五入函数round()
select ename from emp where MONTH_BETWEEN(sysdate,hiredate)/12>18;
month_between没有month没有s
MONTH_BETWEEN(D1,D2)
得到两个日期之间的月数.
SELECT MONTH_BETWEEN(D1,D2) FROM DUAL;