oracle 处理空值的函数
来源:互联网 发布:想成为网络写手 编辑:程序博客网 时间:2024/06/06 00:09
1、nvl(expr1,expr2)
如exp1是空值,则返回exp2,否则返回expr1;
2、nvl2(expr1,expr2,expr3)
如果exp1是空值,则返回expr3,否则返回expr2;
3、coalesce(expr[,expr1]...)
返回参数里面第一个非空值;
with test as
( select 'c11' col_1, '' col_2, 'c31' col_3 from dual union all
select '' col_1, 'c21' col_2, 'c32' col_3 from dual union all
select 'c13' col_1, 'c22' col_2, '' col_3 from dual union all
select '' col_1, 'c23' col_2, 'c33' col_3 from dual union all
select 'c14' col_1, '' col_2, 'c34' col_3 from dual union all
select 'c15' col_1, '' col_2, '' col_3 from dual
)
select col_1, nvl(col_1, col_1) exp_1,
col_2, nvl2(col_2,col_2||',','is null') exp_2,
col_3, coalesce(col_1, col_2, col_3) exp_3
from test;
COL_1 EXP_1 COL_2 EXP_2 COL_3 EXP_3
--------- ----- ------- ------- ----- -----
c11 c11 is null c31 c11
c21 c21, c32 c21
c13 c13 c22 c22, c13
c23 c23, c33 c23
c14 c14 is null c34 c14
c15 c15 is null c15
6 rows selected
- oracle 处理空值的函数
- Oracle的空值处理函数
- Oracle 处理空值的函数
- ORACLE中处理空值NULL的几个通用函数
- Oracle 处理空值
- ORACLE 空值处理
- Oracle对空值的排序处理
- Oracle中处理空值的函数nvl-nvl2-lnnvl-nullif的用法
- nvl函数对空值的处理
- ORACLE处理排序空值
- ORACLE处理排序空值
- ORACLE内置函数大全补充(为空处理函数)
- Oracle空串与null的处理
- oracle 空值处理,排序过滤
- oracle 空值处理,排序过滤
- oracle之空值(NULL)和空值函数使用
- hive 空值的处理
- thymeleaf 空值的处理
- vs调试部分断点进不去的问题
- JavaScript可以在浏览器地址栏直接执行~
- 字符转码
- Ubuntu下安装JDK,Eclipse和Android SDK(有图有真相)
- LR监控Linux系统性能计数器详解
- oracle 处理空值的函数
- [owlpark]电源管理之regulator机制流程(2012-10-20 02:20:02)
- IE下获取触发事件的目标
- UIP tcp/ip协议栈在uCOS-II下的移植
- Linux regulator分析
- Oracle Database: 安全地删除数据库用户
- 腾讯搜搜未必没有未来
- ExtJs4 TreePanel学习
- ios 文件管理 获取文件属性 读取文件