zoukankan      html  css  js  c++  java
  • 【ocp12c】最新Oracle OCP071考试题库(46题)

    46、(10-4) choose two:

    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?

    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)- INSTR(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),'*') "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;

    Answer:AC

    (解析:题意是:您希望只提取具有三个名称的那些客户名称,并显示*符号来代替名称如下注意条件的用法 INSTR(cust_name, ' ',1,2)<>00,意思是从名字中找空格,从第一个开始,查看第二个空格的位置,如果有,说明名字里面就有三个名称,否则只有两个名称。同时INSTR(cust_name, ' ',-1,-2),从倒数第一个空格开始,不能再用-2 了,要用正数)

  • 相关阅读:
    GO-GRPC实践(二) 增加拦截器,实现自定义context(带request_id)、recover以及请求日志打印
    第六章-堆
    第五章-本地方法接口和本地方法栈
    第四章-虚拟机栈
    第三章-运行时数据区及程序计数器
    04-再谈类的加载器
    03-类的加载过程(类的生命周期)详解
    1.编程入门
    SpringBoot 整合 SpringSecurity 梳理
    pip版本过低无法升级问题
  • 原文地址:https://www.cnblogs.com/cnblogs5359/p/10448620.html
Copyright © 2011-2022 走看看