85. View the E xhibit and examine the structure and data in the INVOICE table.
Which statements are true regarding data type conversion in expressions used in queries? (Choose all
that apply.)
A. inv_amt ='0255982' : requires explicit conversion
B. inv_date > '01-02-2008' : uses implicit conversion
C. CONCAT(inv_amt,inv_date) : requires explicit conversion
D. inv_date = '15-february-2008' : uses implicit conversion
E. inv_no BETWEEN '101' AND '110' : uses implicit conversion
Answer: DE
答案解析:
参考:http://blog.csdn.net/rlhua/article/details/12832019
http://blog.csdn.net/rlhua/article/details/12832885
在表达式中,Oracle Server 可以自动执行以下转换:
从 VARCHAR2 或CHAR隐式转换为NUMBER
从VARCHAR2 或CHAR隐式转换为DATE
A隐式转换为数值型,不用显示转换,错误。
B错误,只能用to_date显示转换为特定的格式。
C错误,隐式转换为字符型,如下。
scott@TESTDB> select concat(sal,hiredate) from emp;
CONCAT(SAL,HIREDATE)
----------------------------------------------------
80017-DEC-80
160020-FEB-81
125022-FEB-81
297502-APR-81
D正确,此格式玉默认的格式相融合,可隐式转换
E正确,可隐式转换为数值型。