RAND

{RAND | RANDOM} ([expression])

Parameters

  • expression - any valid numeric expression seeds the session's random number generator.

Description

Calling the function without parameter returns the next a pseudo random number. Calling it with an parameter seeds the session's random number generator. This method returns a double between 0 (including) and 1 (excluding).

Example

Gets a random number for every play:

SELECT random() FROM Play;