您的位置:首页 > 其它

OCP-1Z0-051 第58题 转义字符escape

2014-05-07 08:18 267 查看
一、原题

The PART_CODE column in the SPARES table contains the following list of values:
PART_CODE

A%_WQ123

A%BWQ123

AB_WQ123
Evaluate the following query:

SQL> SELECT part_code

             FROM spares

          WHERE part_code LIKE '%\%_WQ12%' ESCAPE '\';

Which statement is true regarding the outcome of the above query?

A. It produces an error.

B. It displays all values.

C. It displays only the values A%_WQ123 and AB_WQ123 .
D. It displays only the values A%_WQ123 and A%BWQ123.
E. It displays only the values A%BWQ123 and AB_WQ123.

答案:D

二、题目翻译

SPARES表的PART_CODE列包含下面的值:

下面的这个查询:

关于上面查询的结果哪句话是正确的?

A. 会报错。

B. 显示所有的结果。

C. 仅显示A%_WQ123 and AB_WQ123。

D. 仅显示A%_WQ123 and A%BWQ123。

E. 仅显示A%BWQ123 and AB_WQ123。

三、题目解析

因为LIKE '%\%_WQ12%' ESCAPE '\'里的\为转译字符,把第二个%转义,而_下划线没有转义,代表一个字符,所以答案为D
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息