RANDOM

Returns a uniformly-distributed random number x, where 0 <= x < 1.

Typical pseudo-random generators accept a seed, which is set to generate a reproducible pseudo-random sequence. Vertica, however, distributes SQL processing over a cluster of nodes, where each node generates its own independent random sequence.

Results depending on RANDOM are not reproducible because the work might be divided differently across nodes. Therefore, Vertica automatically generates truly random seeds for each node each time a request is executed and does not provide a mechanism for forcing a specific seed.

Behavior Type

Volatile

Syntax

RANDOM()

Parameters

RANDOM has no arguments. Its result is a FLOAT data type (also called DOUBLE PRECISION).

Examples

In the following example, the result is a float, which is >= 0 and < 1.0:

SELECT RANDOM();
      random       
-------------------
 0.211625560652465
(1 row)