JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

SQL coalesce, if null (), nvl 函数

发布时间 2023-04-12 17:50:33作者: tttttting

1. coalesce函数

coalesce(expr1, expr2, ...) - Returns the first non-null argument if exists. Otherwise, null.
返回所有参数中第一个非null的,若均为null,返回null。

SELECT coalesce(NULL, NULL,1);

SELECT coalesce(NULL, NULL);

2. nvl函数

nvl(expr1, expr2) - Returns expr2 if expr1 is null, or expr1 otherwise.

SELECT nvl(NULL, array('2'));

SELECT nvl(array('1'), array('2'))

3. ifnull函数

ifnull(expr1, expr2) - Returns expr2 if expr1 is null, or expr1 otherwise.

和nvl函数一致。

    本栏目推荐文章
  • SQL Server 检测是不是数字型数据的两种方法
  • 函数的参数类型
  • 【C语言】函数的递归调用
  • SQL Join的一些总结
  • SQL Server 高性能写入的一些总结
  • 网络攻击技术开篇——SQL Injection
  • NUS CS1101S:SICP JavaScript 描述:一、使用函数构建抽象
  • asp.net mvc4 controller构造函数
  • 函数返回值
  • 10-函数进阶-作用域
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们