91.View the Exhibit and examine the structure of the PROMOTIONS table. Which two SQL statements woul
来源:互联网 发布:淘宝的91论坛共享号 编辑:程序博客网 时间:2024/06/04 05:54
91.View the Exhibit and examine the structure of the PROMOTIONS table. Which two SQL statements would execute successfully?
B.SELECT promo_begin_date FROM promotions WHERE TO_CHAR(promo_begin_date,'mon dd yy')='jul 01 98';
C.UPDATE promotions SET promo_cost = promo_cost+ 100 WHERE promo_end_date > TO_DATE(SUBSTR('01-JAN-2000',8));
D.SELECT TO_CHAR(promo_begin_date,'dd/month') FROM promotions WHERE promo_begin_date IN (TO_DATE('JUN 01 98'), TO_DATE('JUL 01 98'));
答案:AB
A:正确
B:正确
C:错误
D:错误
C和D的错误都是因为没有指定转换的格式,而默认的格式是通过
NLS_DATE_LANGUAGEE和NLS_DATE_FORMAT决定的,因此他们都存在问题,可以进行如下修改
SQL> select TO_DATE(SUBSTR('01-JAN-2000',8)) from dual;select TO_DATE(SUBSTR('01-JAN-2000',8)) from dualORA-01861: 文字与格式字符串不匹配SQL> alter session set NLS_DATE_FORMAT='yyyy';Session alteredSQL> select TO_DATE(SUBSTR('01-JAN-2000',8)) from dual;TO_DATE(SUBSTR('01-JAN-2000',8------------------------------2000/12/1SQL> select TO_DATE('JUN 01 98') from dual;select TO_DATE('JUN 01 98') from dualORA-01841: (完整) 年份值必须介于 -4713 和 +9999 之间, 且不为 0SQL> alter session set NLS_DATE_FORMAT='MON DD RR';Session alteredSQL> alter SESSION SET NLS_DATE_LANGUAGE='AMERICAN';Session alteredSQL> select TO_DATE('JUN 01 98') from dual;TO_DATE('JUN0198')------------------1998/6/1
0 0
- 91.View the Exhibit and examine the structure of the PROMOTIONS table. Which two SQL statements woul
- 56.View the Exhibit and examine the structure of the PROMOTIONS table.
- 61.View the Exhibit and examine the structure of the PROMOTIONS table.
- 99.View the Exhibit and examine the structure of the PROMOTIONS table.
- 100.View the Exhibit and examine the structure of the PROMOTIONS table.
- 112.View the Exhibit and examine the structure of the PROMOTIONS table.
- 118.View the Exhibit and examine the structure of the PROMOTIONS table.
- 143.View the Exhibit and examine the structure of the PROMOTIONS table.
- 147.View the Exhibit and examine the structure of the PROMOTIONS table.
- 10.View the Exhibit;examine the structure of the PROMOTIONS table.
- 124.View the Exhibit and examine the structure of the PROMOTIONS, SALES, and CUSTOMER tables.
- 8.View the Exhibit and examine the structure of the CUSTOMERS table.
- 11.View the Exhibit and examine the structure of the PRODUCTS table.
- 13.View the Exhibit and examine the structure of the PRODUCTS table.
- 44.View the Exhibit and examine the structure of the ORD table.
- 52.View the Exhibit and examine the structure of the PRODUCTS table.
- 54.View the Exhibit and examine the structure of the CUSTOMERS table.
- 63.View the Exhibit and examine the structure of the PRODUCTS table.
- ZOJ 3329 One Person Game 概率DP 求期望 待定系数法 ★
- 检测到在集成的托管管道模式下不适用的ASP.NET设置的解决方法
- 验证ip地址的正则表达式
- css3 箭头 上下左右
- web应用安全相关
- 91.View the Exhibit and examine the structure of the PROMOTIONS table. Which two SQL statements woul
- C++11中的std::bind
- jquery Deferred的一点用法
- Ubuntu通过串口发送文件给u-boot
- 面试 阿里巴巴
- dubbo/dubbox(二)Thrift协议实现
- 配置Sprintmvc4&tomcat解释中文乱码问题
- hdu 5592 BestCoder Round #65 1003
- leetcode -- Longest Valid Parentheses