STATIC CASE WHEN
Description
STATIC CASE WHEN
evaluates a list of static conditions and replaces itself with the expression for the first static condition that is true.
Syntax
A STATIC CASE WHEN
requires an ELSE
, as at least one of the conditions must be met for there to be an expression that replaces the STATIC CASE WHEN
.
STATIC CASE WHEN static_condition THEN expression [ WHEN static_condition THEN expression ]* ELSE expression END
NULL handling
If a static condition evaluates to NULL, it is treated as if it was false.
Examples
[1] TO_STRING does not support FLOAT and STRING columns as inputs, and it requires an additional format argument for DATE inputs. With STATIC CASE WHEN and COLUMN_TYPE, we can write a string conversion query that is independent of the data type of a column. | ||||||||||||
| ||||||||||||
|