DECODE¶
DECODE(Arg0, Arg1, Arg2, ...)
When Arg0
is Arg1
, outputs Arg2
. When Arg0
is Arg3
,
outputs Arg4
. Repeats until it runs out of pairs of arguments.
At this point, if there is one remaining argument, this is used
as a default value. If not, then the output is NULL
.
Note
Treats NULL
as a literal value that can be matched on.
Therefore, the following:
Is logically equivalent to: