zoukankan      html  css  js  c++  java
  • OCP-1Z0-051-V9.02-98题

    98. Which statement is true regarding the COALESCE function?

    A. It can have a maximum of five expressions in a list. 最多只能有5个表达式,错,无限个

    B. It returns the highest NOT NULL  value in the list for all rows. 返回最高的非空值,错,返回第一个非空值

    C. It requires that all expressions in the list must be of the same data type. 所有都要相同的类型

    D. It requires that at least one of the expressions in the list must have a NOT NULL  value. 至少有一个不是空值,错,可以都是空值,则返回空值

    Answer: C

    答案解析:

    Purpose

    COALESCE (expression_1, expression_2, ...,expression_n)

    列表中第一个非空的表达式是函数的返回值,如果所有的表达式都是空值,最终将返回一个空值。

    COALESCE returns the first non-null expr in the expression list. You must specify at least two expressions. If all occurrences of expr evaluate to null, then the function returns null.

    Oracle Database uses short-circuit evaluation. The database evaluates each expr value and determines whether it is NULL, rather than evaluating all of the expr values before determining whether any of them is NULL.

    If all occurrences of expr are numeric data type or any nonnumeric data type that can be implicitly converted to a numeric data type, then Oracle Database determines the argument with the highest numeric precedence, implicitly converts the remaining arguments to that data type, and returns that data type.

    This function is a generalization of the NVL function.

    You can also use COALESCE as a variety of the CASE expression. For example,

    COALESCE(expr1, expr2)

    is equivalent to:

    CASE WHEN expr1 IS NOT NULL THEN expr1 ELSE expr2 END

    Similarly,

    COALESCE(expr1, expr2, ..., exprn)

    where n >= 3, is equivalent to:

    CASE WHEN expr1 IS NOT NULL THEN expr1
       ELSE COALESCE (expr2, ..., exprn) END
     
     
  • 相关阅读:
    刚加入博客园
    个人作业——软件工程实践总结作业
    前四次作业--个人总结
    项目选题报告(待就业六人组)
    结对第二次—文献摘要热词统计及进阶需求
    结对第一次—原型设计(文献摘要热词统计)
    第一次作业
    logback-spring.xml 配置说明
    k8s 微服务打包上传私库、部署、发布
    k8s离线安装监控Kubernetes集群
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13317195.html
Copyright © 2011-2022 走看看