Add as many case and value pairs as you need. The final value is used when col1's value does not match any of the cases.
The MouseOver below shows an example of DECODE. Mouseover the state of Hawaii HI.
NVL is a simple function that replaces a null value with the specified value. It is useful when you want to perform arithmetic on columns that might contain null values.
In these cases, a null value will cause the arithmetic to result in a null value.
To avoid this, you can substitute zero for null value using the NVL function. Values that are anything other than null remain unchanged. The syntax is shown below.