NVL () function in Oracle
How Oracle's NVL function is used
The total value of a field is obtained by querying, assuming that the value bit null will give a preset default value
Select NVL (SUM (T.DWXHL), 1) from Tb_jhde t where zydm=-1
Here the Nvl method of Use, NVL (Arg,value) represents the assumption that the value of the preceding ARG is NULL then the returned value is
For example, NVL (A, A, b) is to infer whether a is null, assuming that the value of a is not returned. Suppose that the value of return B is obtained by querying the total value of a field, assuming that the value bit null will give a default value of a preset
There is also a practical way to
Declare
I integer
Select NVL (SUM (T.DWXHL), 1) into I from Tb_jhde t where zydm=-1
This allows you to store the obtained aggregate values in the variable i. Assuming that the value of the query is NULL, set its value to the default of 1
The Oracle lower NVL function NVL () function returns a non-null value from two expressions.
Grammar
NVL (EExpression1, EExpression2)
Number of references
EExpression1, EExpression2
If the eExpression1 evaluates to a null value. Then NVL () returns EEXPRESSION2. Assume that EExpression1 evaluates to a value other than null. The EExpression1 is returned. EExpression1 and EExpression2 can be arbitrary data types. Assuming that the result of both EExpression1 and eExpression2 are null values, NVL () is returned. Null..
return value type
character, date, datetime, numeric, currency, logical, or null values
Description
You can use NVL () to remove null values from a calculation or operation in cases where null values are not supported or if NULL values do not matter.
Select NVL (a.name, ' empty ') as name from student a joins school B on a.id=b.id Note: Two number of types to match Q: What is NULL? A: When we do not know the details of what data, it is unknown, can be used null, we call it empty, Oracle, contains null values of the table column length is zero.
Oracle agrees that no field of a data type is empty. In addition to the following two scenarios:
NVL () function in Oracle