NVL
来源:互联网 发布:java笔试基础题 编辑:程序博客网 时间:2024/06/07 10:20
Syntax
Description of the illustration nvl.gif
Purpose
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, thenNVL
returns expr1
.
The arguments expr1
and expr2
can have any datatype. If their datatypes are different, then Oracle Database implicitly converts one to the other. If they are cannot be converted implicitly, the database returns an error. The implicit conversion is implemented as follows:
If
expr1
is character data, then Oracle Database convertsexpr2
to the datatype ofexpr1
before comparing them and returnsVARCHAR2
in the character set ofexpr1
.If
expr1
is numeric, then Oracle determines which argument has the highest numeric precedence, implicitly converts the other argument to that datatype, and returns that datatype.See Also:
Table 2-10, "Implicit Type Conversion Matrix" for more information on implicit conversion and "Numeric Precedence" for information on numeric precedence
Examples
The following example returns a list of employee names and commissions, substituting "Not Applicable" if the employee receives no commission:
SELECT last_name, NVL(TO_CHAR(commission_pct), 'Not Applicable') "COMMISSION" FROM employees WHERE last_name LIKE 'B%' ORDER BY last_name; LAST_NAME COMMISSION------------------------- ----------------------------------------Baer Not ApplicableBaida Not ApplicableBanda .1Bates .15Bell Not ApplicableBernstein .25Bissot Not ApplicableBloom .2Bull Not Applicable
- nvl()
- nvl && (+)
- nvl
- nvl
- nvl
- NVL
- NVL
- NVL
- nvl decode
- nvl函数
- decode &nvl
- NVL()函数
- NVL()函数
- Nvl函数
- nvl函数
- oracle NVL
- nvl函数
- nvl函数
- qt osg 多点触摸
- 怎样在Automator中自动化任务并创建工作流程
- 项目开发准备20160415
- 如何把两张图片拼在一起
- 文章标题
- NVL
- Cmd Markdown 编辑阅读器使用教程
- 详解设计模式(二)
- SVN常见问题及相关原因,供各位查阅
- HDOJ 2192多重背包 01背包模板
- Java的引用数据类型及应用
- mac 下配置protobuf 3.0 golang环境
- 图片压缩生成bitmap工具
- Retrofit使用一:超简单先用上