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




SQL :: Syntax
Basic KBSQL syntax and some examples.
SQL :: ToLower
Returns the value converted to lower case.
SQL :: ToNumeric
Returns the value converted to a number.
SQL :: ToProper
Returns the value with the first letter of each word capitalized (title case).
SQL :: ToString
Returns the number as a string, so that + concatenates it instead of adding it.
SQL :: ToUpper
Returns the value converted to upper case.
SQL :: Trim
Removes white space from the start and end of the value. When characters is given, each of those characters is removed from the start and end instead.