Scalar functions
Scalar functions evaluate expressions and return one value per input row. They transform text, numbers, dates, structured values and other SQL data.
Calling a function
text
function_name(argument, ...)Function names ignore ASCII case. Use the documented spelling, including underscores. Accepted argument counts, conversion rules and NULL behavior are stated for each function; similar names in another database do not imply identical overloads.
sql
SELECT lower('HELLO'), abs(-7), coalesce(NULL, 'fallback')
FORMAT csv;text
"hello",7,"fallback"Unlike scalar functions, aggregates combine rows, table functions provide rows in FROM, and window functions read related rows while retaining each input row.
Function families
- Arithmetic functions
- Array functions
- Bit functions
- Comparison functions
- Conditional functions and CASE
- Date and time functions
- Vector distances
- Encoding and binary functions
- Functions for NULL values
- Geographic functions
- Hash and digest functions
- IP address and network functions
- JSON functions
- Logical expressions
- Mathematical functions
- Utility functions
- Random functions
- Rounding functions
- Splitting and joining strings
- String functions
- String replacement functions
- String search and full-text functions
- Tuple functions
- Map functions
- Type conversion functions
- UUID functions