IIF



Short for "immediate if": returns whenTrue when the condition is true and whenFalse otherwise. The condition is usually one of the boolean functions such as IsEqual or IsGreater.

String IIF(Boolean condition, String whenTrue, String whenFalse)

Conditions

The condition must be a function call. Comparison operators such as 1 = 1 are only supported in WHERE and ON clauses.


round-pushpin Flags the rows where the English text is exactly 'cats'.
SELECT
    English,
    IIF(IsEqual(English, 'cats'), 'YES!', 'no...') as IsCats
FROM
    WordList:FlatTranslate
WHERE
    English LIKE '%cats'

round-pushpin Nests functions in the condition.
SELECT IIF(IsGreater(Length('Hello World'), 10), 'Is True', 'Is False') as Result FROM Single