ITPub博客

首页 > 数据库 > Oracle > OCP 1Z0-051-83

OCP 1Z0-051-83

原创 Oracle 作者:LuiseDalian 时间:2014-05-17 07:21:24 0 删除 编辑
(83)Examine the data in the CUST_NAME column of the CUSTOMERS table.

CUST_NAME

Lex De Haan

Renske Ladwig

Jose Manuel Urman

Jason Mallin

You want to extract only those customer names that have three names and display the * symbol in place of the first name as follows:

CUST NAME

*** De Haan

**** Manuel Urman

Which two queries give the required output? (Choose two.)

A.

SELECT LPAD(SUBSTR(cust_name, INSTR(cust_name,' ')), LENGTH(cust_name), '*') "CUST NAME"

FROM customers

WHERE INSTR(cust_name, ' ', 1, 2) <> 0;

B.

SELECT LPAD(SUBSTR(cust_name,INSTR(cust_name,' ')), LENGTH(cust_name),'*') "CUST NAME"

FROM customers

WHERE INSTR(cust_name, ' ', -1, 2) <> 0;

C.

SELECT LPAD(SUBSTR(cust_name,INSTR(cust_name,'  ')), LENGTH(cust_name)- INSTR(cust_name,' '), '*') "CUST NAME"

FROM customers

WHERE INSTR(cust_name, ' ',-1,-2)<>0;

D.

SELECT LPAD(SUBSTR(cust_name,INSTR(cust_name, ' ')), LENGTH(cust_name) - INSTR(cust_name,' '),'*') "CUST NAME"

FROM customers

WHERE INSTR(cust_name, ' ', 1, 2) <> 0 ;


答案:(A、B)

D(X),LPAD第2个参数提供的值不正确


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1163100/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: OCP 1Z0-051-87
下一篇: OCP 1Z0-051-86
请登录后发表评论 登录
全部评论

注册时间:2012-02-06

  • 博文量
    1986
  • 访问量
    6040893