Updated on 2025-09-05 GMT+08:00

Conditional Functions

The following table lists the conditional functions supported by SecMaster SQL syntax.

Table 1 Conditional functions supported by SecMaster SQL syntax

Function

Function Description

CASE value WHEN value1_1 [, value1_2]* THEN RESULT1 (WHEN value2_1 [, value2_2 ]* THEN result_2)* (ELSE result_z) END

Returns resultX when the first value in (valueX_1, valueX_2, ...) is included. If there is no matching value, returns result_z if provided, otherwise returns NULL.

CASE WHEN condition1 THEN result1 (WHEN condition2 THEN result2)* (ELSE result_z) END

Returns resultX when the first condition X is met. If no conditions are met, returns result_z if provided, otherwise returns NULL.

IF(condition, true_value, false_value)

Returns true_value if the condition is met, otherwise returns false_value. For example, IF(5 > 3, 5, 3) returns 5.