The string, numeric, datetime, and datatypeconversion functions are scalar functions in which an operation denoted by a function name is followed by a pair of parenthesis that enclose zero or more specified arguments. Each scalar function returns a single value.
set‑function::=COUNT(*) | {AVG | MAX | MIN | SUM | COUNT} ({ALL | DISTINCT} expression)
null‑function::= {NULLVAL_CHAR() | NULLVAL_INT()}
The system, string, numeric, and datetime functions are scalar functions in which an operation denoted by a function name is followed by a pair of parenthesis that enclose zero or more specified arguments. Each scalar function returns a single value.
Datatype conversion functions are used to implement the {fn CONVERT(value, odbc‑typename)} escape clauses that are defined by ODBC. However, you should use CAST(value AS sql‑typename), which is defined in SQL-92 and is fully supported by solidDB.
The NULLIF function returns NULL if the first parameter is equal to the second parameter; otherwise, it returns the first parameter. It is equivalent to IF (p1 = p2) THEN RETURN NULL ELSE RETURN p1; The NULLIF function is useful if you have a special value that serves as a flag to indicate NULL. You can use NULLIF to convert that special value to NULL. In other words, it behaves like IF (p1 = NullFlag) THEN RETURN NULL ELSE RETURN p1;
COALESCE returns the first non-NULL argument. The list of arguments can be of almost any length. All arguments should be of the same (or compatible) data types.
case‑specification::=CASE [value‑exp] WHENvalue‑exp THEN {value‑exp} [WHENvalue‑exp THEN {value‑exp} …] [ELSE {value‑exp}] END