Flow Control

IF

IF_THEN(boolean_expr,true_expr,else_expr)

IF_THEN_ELSE(boolean_expr,true_expr,else_expr)

Returns true_expr if boolean_expr evaluates to true, otherwise returns else_expr.

output type:the type returned by true_expr or else_expr (must be the same).

See also

If Expr

Example:

1
dual(2) | select(s, IF(s CONTAINS '0', 'contains zero', 'has no zero'));
s if_then
0ho0 contains zero
1ho1 has no zero

IF_THEN(boolean_expr,true_expr)

IF_THEN_ELSE(boolean_expr,true_expr)

Returns true_expr if boolean_expr evaluates to true, otherwise returns NULL.

output type:the type returned by true_expr or else_expr (must be the same).

Example:

1
dual(2) | select(s, IF(s CONTAINS '0', 'contains zero'));
s if_then
0ho0 contains zero
1ho1 NULL

CASE

See also

Case Expr