IF-THEN-ELSE

Summary

The IF-THEN-ELSE statement provides an alternative syntax to the CASE statement.

Syntax

IF <logical expression> THEN
<arithmetic expression>
[ELSE <arithmetic expression>]
END

Return Type

Byte

Examples

SELECT boolean1,
IF boolean1 = true
THEN 'Yay, it''s TRUE!!!'
ELSE 'Oh no! FALSE!!'
END
FROM AllTypes();

Related Functions

CASE