代码改变世界

12c OCP考试专项 [1z0-071]-Q3:日期格式(2020.06.12)

2020-06-12 17:36  askscuti  阅读(256)  评论(0编辑  收藏  举报

A session's NLS_DATE_FORMAT is set to DD MON YYYY.
which two queries return the value 1 Jan 2019?

A. SELECT DATE '2019-01-01' FROM DUAL;
B. SELECT TO_DATE('2019-01-01') FROM DUAL;
C. SELECT TO_CHAR('2019-01-01') FROM DUAL;
D. SELECT TO_DATE('2019-01-01','YYYY-MM-DD') FROM DUAL;
E. SELECT '2019-01-01' FROM DUAL;

Answer: AD

Explanation:

设置当前会话日期格式

alter session set nls_date_format='DD MON YYYY';

B:ORA-01861: literal does not match format string
C:2019-01-01
E:2019-01-01

提示:答案为个人理解和解答,难免有错,也欢迎大家及时指正。