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.)
下面是INVOICE表的结构:
关于查询中的表达式中的数据类型转换,哪句话是正确的?(选择所有正确的项)
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 (使用了隐式转换)
答案:D、E
解析:
A:发生了隐式转换,字符串变为了NUMBER进行比较
B:inv_date为date类型,格式为15-FEB-08,字符串'01-02-2008'格式不符合,不能发生隐式转换,需要用to_date()显式转换
C:CONCAT进行字符串连接,将inv_amt,inv_date发生隐式转换,然后进行字符串连接
D:inv_date为date类型,格式为15-FEB-08,字符串'15-february-2008'格式一致,发生隐式转换,将字符串'15-february-2008'变为了date类型
E:同A