Oracle DECODE Function Parameters Guide
The DECODE function in Oracle accepts the following parameters:
- expression: the expression or column that needs to be compared.
- search_value1: The first value to be compared.
- result1: Return the result if the expression equals search_value1.
- search_value2: the second value to be compared.
- result2: the result returned if the expression is equal to search_value2.
- …: Multiple conditions can be compared by repeatedly adding pairs of search_value and result parameters.
- default: the default result returned if the expression does not meet any conditions.
Note: Multiple search_value and result pairs can be added to meet the requirements for comparing multiple conditions and returning different results.