IIF

 

The function IIF returns one of 2 values depends of the evaluation of an expression. This is not a standard SQL function and exist for compatible with MS Access.

SQL Syntax:
 
   IIF( expression, true-value1, false-value )
Parameters:
 
  expression
Any Boolean expression.

true-value

The return value if the expression is TRUE.

false-value

The return value if the expression is FALSE.

Return Type:
 
  The same as the value.

Examples:

  • SELECT iif( price < 0 , 'red', 'black' )

see also:
IFNULL
SQL System Functions
 


100% pure Java DBMS
Mirror Site