SELECT, WHERE, ORDER BY, and GROUP BY, and can be nested (lower(trim(title))). Arguments are columns, literals, or other functions.
Column aliases
Rename an output column withAS. The AS keyword is optional.
lower(title)), and an aggregate uses its default name (sum_amount, count).
Aliases only rename output columns. They are not referenceable from
WHERE, ORDER BY, or GROUP BY — repeat the expression there instead. SELECT DISTINCT dedupes on the underlying expression, not the alias.Scalar functions in SELECT
Scalar functions in WHERE
NULL result never matches.
Scalar functions in ORDER BY
ORDER BY score (relevance) remains the default for retrieval queries.
Scalar functions in GROUP BY
Function reference
String
Numeric
Date / time
Timestamps are parsed from stored
Date/Timestamp columns (ISO YYYY-MM-DD[THH:MM:SS]).
Conditional
NULL handling
A missing column evaluates toNULL. Functions propagate NULL (a NULL argument yields NULL) except coalesce/ifnull (which skip nulls), nullif, and concat (which treats NULL as the empty string). In projection, NULL renders as an empty string.
Limitations
- Functions on the left of
IN,BETWEEN,LIKE, and inHAVINGare not supported yet — use a plain comparison (func(x) = 'y'). ORDER BY <function>is not supported on materialized views (cached rows lack the source columns).- Aggregate over a function (
SUM(abs(x))) cannot referencetextin the GROUP BY scan path.
