Sql

isnullのnvlのSQLサーバーとオラクル



Sql Server Oracle Nvl Isnull



最近、同社の製品はデータベースの移行を行っており、ここで要約するために、これら2つの機能を同様の機能で使用しています。


Grammar
ISNULL ( check_expression , replacement_value)

Parameters
check_expression
It will be checked against NULL. check_expression can be of any type.

replacement_value
In check_expression to NULL will return expression. replacement_value must have the same type check_expresssion.

Return Type
Check_expression returns the same type.

Note
If check_expression is not NULL, then the return value of the expression otherwise it returns replacement_value.

----------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------
nvl () function

Two expressions returned from a non-null value.

grammar

NVL(eExpression1, eExpression2)

parameter
eExpression1, eExpression2

If the calculation 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

Explanation

Without support null or null values ​​insignificant, may be used of the NVL () or a null value to calculate removing operation.

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

Note: The two types of parameters have to be matched