zoukankan      html  css  js  c++  java
  • oracle nvl,nvl2,coalesce几个函数的区别

    1.nvl(exp1,exp2)

    NVL lets you replace null (returned as a blank) with a string in the results of a query. If expr1 is null, then NVL returns expr2. If expr1 is not null, then NVL returnsexpr1.

    该函数是处理表达式中的空值:假设表达式exp1是空值,则该函数返回表达式exp2的值,

                            假设表达式exp1没有是空值,则该函数返回表达式exp1的值。

    2.nvl2(exp1,exp2,exp3)

    NVL2 lets you determine the value returned by a query based on whether a specified expression is null or not null. If expr1 is not null, then NVL2 returns expr2. Ifexpr1 is null, then NVL2 returns expr3.

    该函数决意exp1离去是空值和非空值时返回哪个表达式:

                            假设exp1为空值,则返回exp3

                                                假设exp1非空,返回exp2。

    3.coalesce(exp1,exp2,.....)

    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.

    该函数正在括号里全数的表达式中返回第一个非空值,假设都是空值,则返回空值,表达式最少是两个。

  • 相关阅读:
    IOS AFN (第三方请求)
    IOS ASI (第三方请求)
    OC Copy and MutableCopy的使用
    OC NSMutableArray
    OC NSArray使用
    OC NSMutableString的使用
    OC 指向指针的指针
    OC Nsstring的使用
    Code First :使用Entity. Framework编程(4) ----转发 收藏
    Code First :使用Entity. Framework编程(3) ----转发 收藏
  • 原文地址:https://www.cnblogs.com/xuyuanjia/p/6027226.html
Copyright © 2011-2022 走看看