Updated on 2026-11-06 GMT+08:00

rand

The rand function is used to return a uniformly distributed random number greater than or equal to 0 and less than 1.

Syntax

rand(INT seed) 

Parameters

Parameter

Mandatory

Type

Description

seed

No

INT

The format of parameter seed is an integer format. If a seed is specified, a stable sequence of random numbers will be generated under the same runtime environment.

Return Values

Returns a value of type DOUBLE.

Example Code

Returns 0.3668915240363728.

select rand(); 

Returns 0.25738143505962285.

select rand(3);