DBMS_RANDOM¶
Example¶
Generate a random number between 0 and 1:
SELECT DBMS_RANDOM.VALUE(0,1);
To get a random integer in a range, use a low and high as the lower and upper bounds. The result will be greater than or equal to low, but less than high. To get an integer ranging from 0 to 99, run the following command:
SELECT TRUNC(DBMS_RANDOM.VALUE(0,100));