The oracle Jane null null problem with nvl (a, b) function to solve

The oracle Jane null null problem with nvl (a, b) function to solve

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/u013821825/article/details/48766749

 

Null values ​​in oracle problem:

Expression containing null are both null, oracle in null = null!;

 

Use nvl (a, b) function to solve the problem of a null value:

Two expressions returned from a non-null value.

Syntax

NVL (eExpression1, eExpression2)

parameters
eExpression1, eExpression2

If the result is eExpression1 null value of the NVL () Returns eExpression2. If the calculation result is not a null value eExpression1, eExpression1 is returned. eExpression1 eExpression2 and may be any data type. If the results are all the eExpression2 eExpression1 with null value of the NVL () returns .NULL ..

Return type

character, date, time-of-date, numeric, money, logical, or a null value

described

without support null or null values insignificant, may be used of the NVL () operation to remove or calculated the null value.

select nvl(a.name,'空得') as name from student a join school b on a.ID=b.ID

Guess you like

Origin www.cnblogs.com/xudj/p/11765478.html