主题:Oracle函数总结 NVL
来源:互联网 发布:java开发工程师部门 编辑:程序博客网 时间:2024/06/15 22:15
NVL
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, then NVL
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 Applicable
Baida Not Applicable
Banda .1
Bates .15
Bell Not Applicable
Bernstein .25
Bissot Not Applicable
Bloom .2
Bull Not Applicable
- 主题:Oracle函数总结 NVL
- 主题:Oracle函数总结
- Oracle的Nvl函数
- Oracle Nvl函数
- Oracle NVL函数
- Oracle的nvl函数
- Oracle的Nvl函数
- Oracle nvl()函数
- Oracle Nvl() 函数用法
- Oracle函数NVL
- Oracle nvl( ) 函数
- Oracle NVL 函数
- oracle nvl( ) 函数
- oracle中nvl()函数
- 【转】oracle nvl函数
- Oracle nvl 函数
- oracle中nvl()函数
- Oracle nvl函数用法
- 我的CSDN
- 清理UNDOTBS表空间,获取20G空间
- Microsoft Visual Studio 2010体验(3)
- 位操作快于算术操作(也算常识吧)
- Hibernate一级缓存
- 主题:Oracle函数总结 NVL
- 如何处理好合伙之之间的关系
- 组合算法的实现
- 失去掉点隐藏!!!很酷
- Delphi中流的使用(比较全面)
- 序列化 (serialization)
- 图的小算法
- 鸟哥的私房菜
- ZFS for Mac OS