You can use the CASE function to provide conditional values to an expression.
You cannot use the CASE function to provide conditional execution of statements as in other programming languages.
The result of a CASE function is always a scalar value. You can use CASE in two different ways:
Select a result depending on the possible values that a variable, column, or expression can have. This is called Simple CASE. CASE returns the value correspondent to the first value that is equal to the searched expression. Listing 11.16 contains three examples using the CASE function to provide a verbose output.
The CASE function evaluates in sequence several independent conditions. The CASE function returns the result correspondent ...