OCP-1Z0-051 第79题 TRIM,REPLACE,LOWER函数

来源:互联网 发布:mysql存储优化 编辑:程序博客网 时间:2024/06/14 21:08
一、原题
View the Exhibit and examine the structure of the CUSTOMERS table.

In the CUSTOMERS table, the CUST_LAST_NAME column contains the values 'Anderson' and 'Ausson'.
You issue the following query:
SQL> SELECT LOWER(REPLACE(TRIM('son' FROM cust_last_name),'An','O'))
FROM CUSTOMERS
WHERE LOWER(cust_last_name) LIKE 'a%n';
What would be the outcome?
A. 'Oder' and 'Aus'.
B. an error because the TRIM function specified is not valid.
C. an error because the LOWER function specified is not valid.
D. an error because the REPLACE function specified is not valid.

答案:B

二、题目翻译
看下面CUSTOMERS表的结构
表中CUST_LAST_NAME列包含'Anderson' and 'Ausson'值.
执行下面的SQL查询语句
执行结果是什么?
A.'Oder' and 'Aus.
B.报错,因为TRIM函数无效。
C.报错,因为LOWER函数无效。
D.报错,因为REPLACE函数无效。

三、题目解析
因为TRIM('son' FROM cust_last_name)第一个参数不能是多个字符,只能是一个,这里,有'son'三个字符,
SQL> select TRIM('son' FROM 'Anderson') from dual;
select TRIM('son' FROM 'Anderson') from dual
       *
ERROR at line 1:
ORA-30001: trim set should have only one character
0 0
原创粉丝点击