IF expressions

Sets a search condition to return a specific subset of data.

Syntax 1
IF search-condition
THEN expression1
[ ELSE expression2 ]
ENDIF
Remarks

For compatibility reasons, this expression can end in either ENDIF or END IF.

This expression returns the following:

  • If search-condition is TRUE, the IF expression returns expression1.
  • If search-condition is FALSE and an ELSE clause is specified, the IF expression returns expression2.
  • If search-condition is FALSE, and there is no expression2, the IF expression returns NULL.
  • If search-condition is UNKNOWN, the IF expression returns NULL.
See also