hash()

Returns an integer with the hash of the value. Note that this is not a cryptographic hash

Arguments & returns

hash(param, …)

Scalar
Overload link param … Varargs Returns
#01 ANY ANY UBIGINT

… accepts a variable number of arguments of the type shown.

Example

hash example
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Engine example · Run to view results.

In other engines

Used in larger rewrites 1

These examples use hash as one part of a larger SQL translation.

Snowflakeuniform()

UNIFORM(1, 10, 5)
In DuckDB
CAST(FLOOR(1 + (ABS(HASH(5)) % 1000000) / 1000000.0 * (10 - 1 + 1)) AS BIGINT)

SQLGlot example ↗