Skip to main content

Functions

Standard functions

Function

Description

CAST

TRY_CAST

IF

NULL Handling functions

Function

Description

COALESCE

NULLIF

Math Functions

Function

Description

ABS

COS

Returns the cosine of expr.

LOG

Returns the logarithm of expr with base

LOG2

Returns the logarithm of expr with base 2

LOG10

Returns the logarithm of expr with base 10

POWER

RANDOM

Generates a pseudo-random number

SIN

Returns the sine of a number

SQRT

TAN

ROUND

String functions

Function

Description

.

Table/column name separator

LEFT

Get substring from left

LENGTH

Gets the length of a STRING or BYTES value

RIGHT

Get substring from right

REPLACE

Replace all occurrences of a substring

CONCAT

INSTR

LOWER

Returns the string text to lower-case

UPPER

Returns the string text to upper-case

LPAD

LTRIM

RTRIM

SPLIT_PART

SUBSTRING

TRIM

STRPOS

Returns the position of the first occurence of a aubstring in a string

Datetime functions

Function

Description

DATEDIFF

Returns the span between two dates

DATE_TRUNC

Truncates a date or timestamp to the specified unit

TIMESTAMPADD

Adds the specified interval to a timestamp

TIMESTAMPDIFF

Returns the span between two timestamps

TO_DATE

Converts a string to a date using the specified format string

TO_TIMESTAMP

Converts a string to a timestamp using the specified format string

CONVERT_TIMEZONE

EXTRACT

LAST_DAY

CURRENT_DATE

Date part functions

Other functions

Function

Description

GREATEST

SHA256

TO_HEX