DECODE

DECODE(value, whenValue, thenValue [,...])

Description

Returns the first matching value. NULL is considered to match NULL. If no match was found, then NULL or the last parameter (if the parameter count is even) is returned.

Examples

DECODE(RAND()>0.5, 0, 'Red', 1, 'Black')