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

一、原题
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
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值