Numeric Functions
| Function | Description |
|---|---|
ABS(n) | Absolute value |
CEILING(n) | Smallest integer >= n |
FLOOR(n) | Largest integer <= n |
ROUND(n, d) | Round n to d decimal places |
TRUNCATE(n, d) | Truncate n to d decimal places |
String Functions
| Function | Description |
|---|---|
ASCII(s) | ASCII code of the first character |
CHAR(n) | Character for ASCII code n |
CONCAT(s1, s2, ...) | Concatenate strings (NULLs treated as empty) |
CONCAT_WS(sep, s1, s2, ...) | Concatenate with separator, skipping NULLs |
INSTR(s, sub) | Position of first occurrence of sub in s (1-based) |
LEFT(s, n) | First n characters |
LENGTH(s) | Length in characters |
LOWER(s) | Convert to lowercase |
LPAD(s, n, pad) | Left-pad s to length n with pad string |
LTRIM(s) | Remove leading whitespace |
RIGHT(s, n) | Last n characters |
RPAD(s, n, pad) | Right-pad s to length n with pad string |
RTRIM(s) | Remove trailing whitespace |
SUBSTRING(s, pos, len) | Extract substring (1-based position) |
TRIM(s) | Remove leading and trailing whitespace |
UPPER(s) | Convert to uppercase |
Conditional Functions
IF(condition, true_value, false_value) — returns true_value when condition is truthy, otherwise false_value:
UUID
Generate a random UUID v4:Date/Time Functions
| Function | Description |
|---|---|
CURRENT_DATE() | Current date as YYYY-MM-DD |
CURRENT_TIMESTAMP() | Current date and time as a string |
Aggregate Functions
| Function | Description |
|---|---|
COUNT(*) | Count all rows |
COUNT(col) | Count non-NULL values |
SUM(col) | Sum of non-NULL values |
AVG(col) | Average of non-NULL values |
MIN(col) | Minimum value |
MAX(col) | Maximum value |
STDDEV(col) | Population standard deviation |
GROUP BY and HAVING.
Not Supported
EXTRACT,DATE_ADD,DATE_DIFF,DATEDIFF,NOW()CONVERT/CAST