首页 > 数据库 > Oracle > OCP 1Z0-051-86
|
CUST_TRANS Name Null Type CUSTNO NOT NULL CHAR(2) TRANSDATE DATE TRANSAMT NUMBER(6,2) CUSTNO TRANSDATE TRANSAMT
|
Dates are stored in the default date format dd-mon-rr in the CUST_TRANS table. Which SQL statements would execute successfully? (Choose three .)
A. SELECT transdate + '10' FROM cust_trans;
B. SELECT * FROM cust_trans WHERE transdate = '01-01-07';
C. SELECT transamt FROM cust_trans WHERE custno > '11';
D. SELECT * FROM cust_trans WHERE transdate='01-JANUARY-07';
E. SELECT custno + 'A' FROM cust_trans WHERE transamt > 2000;
答案:(A、C、D)
解析:
A,将'10'转换为数字10
|
-- B(X),提供的字符串不符合默认的日期格式 -- D,虽然默认的日期格式是短的月份,但提供长的月份也可正确执行 scott@TESTDB11>select * from emp where hiredate = '17-DECEMBER-80';
-- E,字符型数据进行加法运算,会先隐式转换为数值, 'A'转换失败 |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1163101/ ,如需转载,请注明出处,否则将追究法律责任。