需要检查员工从入职之日起是否已经过了9个月。
答案 0 :(得分:0)
创建示例数据为:
create table employee(id number,hire_date date);
insert into employee values(1,'12-APR-2017');
insert into employee values(2,'18-Oct-2017');
insert into employee values(3,'01-Jan-2018');
select id,hire_date, case when months_between(sysdate,hire_date) > 9 then 'Crossed' else 'Not-Crossed' end is_crossed from employee;
输出将是:
ID HIRE_DATE IS_CROSSED
1 12-APR-17 Crossed
2 18-OCT-17 Not-Crossed
3 01-JAN-18 Not-Crossed
答案 1 :(得分:0)
选择to_char(TO_DATE(joindt,'DD / MM / RRRR')) 谢谢大家。我有解决办法。