IIF
Returns one of two values, depending on whether the Boolean expression evaluates to true or false.
Syntax
IIF ( boolean_expression, true_value, false_value )
Arguments
boolean_expression
A valid Boolean expression. If this argument is not a Boolean expression, then a syntax error is raised.
true_value
Value to return if boolean_expression evaluates to true.
false_value
Value to return if boolean_expression evaluates to false.
Return types
Returns the data type with the highest precedence from the types in true_value and false_value.
Example
SELECT IIF ( 2 > 1, 'TRUE', 'FALSE' );