Choose the best answersession
The EMPLOYEES table contains columns EMP_ID of data type NUMBER and HIRE_DATE of data type DATEide
You want to display the date of the first Monday after the completion of six months since hiringit
The NLS_TERRITORY parameter is set to AMERICA in the session and, therefore, Sunday is the first day ofthe weekio
Which query can be used?table
A) SELECT emp_id,NEXT_DAY(ADD_MONTHS(hite_date,6), 'MONDAY') FROM employees;class
B) SELECT emp_id,ADD_MONTHS(hire_date,6), NEXT_DAY('MONDAY') FROM employees;sed
C) SELECT emp_id,NEXT_DAY(MONTHS_BETWEEN(hire_date,SYSDATE),6) FROM employees;date
D) SELECT emp_id,NEXT_DAY(ADD_MONTHS(hire_date,6),1) FROM employees;next
Answer:Atab
(解析:本題 A 和 D 的答案很是類似,可是由於週日是第一天,因此 D 答案顯示的是週日的日期。
在使用 next_day 的時候,要注意字符集,若是是中文的,就不能用 monday,而是用星期一:
SELECT NEXT_DAY(ADD_MONTHS(hiredate,6), '星期一') from emp2;