One, decode () function
1. Grammar
DECODE (Control_value,value1,result1[,value2,result2 ...] [, Default_result]);
Control _value: The value you are trying to process. The decode function compares this value to the subsequent sequence of even orders to determine the return value.
Value1: is a numerical value of a constituent sequence. If the input value matches successfully, the corresponding result is returned. corresponding to an empty return value, you can use the keyword NULL for the corresponding.
RESULT1: Is the result value of a constituent sequence pair.
Default_result The default value returned by the function when it fails to match any one of the values.
2. Usage
When the first argument equals 1 o'clock, return "you are standing here."
When the first argument equals 2 o'clock, return "do not move around"
Returns "I'll buy some oranges" when the first parameter equals another value.
The decode () function in Oracle