Oracle null value processing function
/*********** NUL, NVL2, and NULLIF usage in Oracle ***************/
NULL indicates a NULL value or an invalid value.
1. NVL (expr1, expr2) Function
If expr1 is NULL, expr2 is returned. If not NULL, expr1 is returned. Note that the two types must be consistent.
Eg: select nvl (column, 0) from dual -- the value of column is null, and 0 is displayed.
2. NVL2 (expr1, expr2, expr3)
If expr1 is not NULL, expr2 is returned. If it is NULL, expr3 is returned. If the expr2 and expr3 types are different, expr3 will be converted to the expr2 type.
Eg: SELECT NVL2 (column,) from dual -- the column value is not null, and 1 is displayed. If the column name value is null, 0 is displayed.
3. NULLIF (expr1, expr2)-> equal to expr1 and expr2 return NULL, otherwise expr1 is returned.
Detailed examples of Oracle function GREATEST Functions
Single-row conversion functions of Oracle Functions
Oracle functions that generate dynamic prefixes and auto-increment numbers
Replace () for Oracle Functions ()
Oracle Functions
Differences in case and decode usage and Performance Comparison of Oracle Functions