Skip to main content
Scalar function
Aliases: rand The zero-argument function returns a non-NULL value.

Syntax

Scalar

Arguments

Takes no arguments.

Returns

  • Type: DOUBLE outside Snowflake dialect; BIGINT in Snowflake dialect
  • Possible values: DOUBLE values in [0, 1) outside Snowflake; the full signed BIGINT range in Snowflake.
  • NULL behavior: The zero-argument function returns a non-NULL value.

Properties

Usage notes

  • The function generates a value per row. Repeated evaluations can produce different values.

Examples

A variable value

  • The source dialect determines the return type.
Variable result: The value changes between evaluations. Outside Snowflake dialect it is a DOUBLE in [0, 1); in Snowflake dialect it is a signed BIGINT.

Limitations

  • This function takes no arguments. A seed argument is not supported.
  • In the Snowflake dialect, the result is BIGINT even when query tools report DOUBLE. Other dialects return DOUBLE.
Last modified on October 15, 2026