发布时间:2019-08-24 09:24:04编辑:auto阅读(2013)
一、原题
You need to extract details of those products in the SALES table where the PROD_ID column contains the string '_D123'.
Which WHERE clause could be used in the SELECT statement to get the required output?
A. WHERE prod_id LIKE '%_D123%' ESCAPE '_'
B. WHERE prod_id LIKE '%\_D123%' ESCAPE '\'
C. WHERE prod_id LIKE '%_D123%' ESCAPE '%_'
D. WHERE prod_id LIKE '%\_D123%' ESCAPE '\_'
答案 B
二、题目翻译
要从SALES表中提取出PROD_ID列包含'_D123'字符串的产品明细。
下面哪一个WHERE条件子句可以获得所需的输出结果?
三、题目解析
ESCAPE子句为指定转译字符,因为'_'下画线在LIKE子句中指的是任意一个字符,所以需要把'_'下画线进行转义,转义字符设置为'\'。
上一篇: Python 运算符
下一篇: 《深入Python》个人总结2
51295
50745
41342
38154
32624
29523
28372
23243
23211
21534
1608°
2342°
1942°
1883°
2213°
1930°
2613°
4390°
4233°
3005°