ITPub博客

首页 > 数据库 > Oracle > NVL2函数

NVL2函数

Oracle 作者:饽饽131 时间:2013-04-19 23:38:43 0 删除 编辑

文档地址:http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions106.htm#SQLRF00685

 

NVL2

Syntax


Description of the illustration nvl2.gif

Purpose

 

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. If expr1 is null, then NVL2 returns expr3.--函数作用

 

The argument expr1 can have any datatype. The arguments expr2 and expr3 can have any datatypes except LONG.

If the datatypes of expr2 and expr3 are different:

  • If expr2 is character data, then Oracle Database converts expr3 to the datatype of expr2 before comparing them unless expr3 is a null constant. In that case, a datatype conversion is not necessary. Oracle returns VARCHAR2 in the character set of expr2.

  • If expr2 is numeric, then Oracle determines which argument has the highest numeric precedence, implicitly converts the other argument to that datatype, and returns that datatype.

<!-- 正文结束 -->

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26216595/viewspace-1115605/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2011-08-28

最新文章