Returns a DOUBLE precision, random number x, where 0 <= x <1, with an optional seed.
Parameter |
Description |
---|---|
integer-expression |
The optional seed used to create a random number. This argument allows you to create repeatable random number sequences. |
DOUBLE
The following statement returns a 5% sampling of a table:
SELECT AVG(table1.number_of_cars), AVG(table1.number_of_tvs)FROM table1 WHERE RAND(ROWID(table1)) < .05 and table1.income < 50000;
The following statement returns a value of approximately 941392926249216914:
SELECT RAND( 4 ) FROM iq_dummy
If RAND is called with a FROM clause and an argument in a query containing only tables in IQ stores, the function returns an arbitrary but repeatable value.
When no argument is called, RAND is a non-deterministic function. Successive calls to RAND might return different values. The query optimizer does not cache the results of the RAND function