random function

Returns a random value between 0 and 1.

Syntax

random( [seed] )

Arguments

  • seed: An optional INTEGER literal.

Returns

A DOUBLE.

The function generates pseudo random results with independent and identically distributed uniformly distributed values in [0, 1).

This function is non-deterministic.

rand is a synonym for random function.

Examples

> SELECT rand();
 0.9629742951434543
> SELECT rand(0);
 0.8446490682263027
> SELECT rand(null);
 0.8446490682263027