大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说【2019年8月版】OCP 071认证考试原题-第38题,希望您对编程的造诣更进一步.
choose two.
You need to calculate the number of days from 1st January 2019 until today.
Dates are stored in the default format of DD-MON-RR.
Which two queries give the required output?
A) SELECT SYSDATE – TO_DATE (” 01-JANUARY-2019″ ) FROM DUAL;
B) SELECT TO_DATE (SYSDATE, ” DD/MONTH/YYYY” ) – “01/JANUARY/2019” FROM DUAL;
C) SELECT ROUND (SYSDATE – TO_DATE(” 01/JANUARY/2019″ ) ) FROM DUAL;
D) SELECT TO_CHAR (SYSDATE, ” DD-MON-YYYY”) – “01-JAN-2019” FROM DUAL;
E) SELECT ROUND (SYSDATE- “01-JAN-2019”) FROM DUAL:
Answer:AC
(解析:在进行日期计算的时候需要用转换函数把字符型的转换成日期型,oracle 不会隐式转换。)
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/10738.html