Home >Database >Mysql Tutorial >How to generate the same sequence of random numbers in MySQL?
When called with an integer argument, RAND( ) uses that value as the seed for the random number generator. RAND( ) generates the same sequence of random numbers each time the generator is seeded with a given value. The following example will demonstrate it -
mysql> Select RAND(1), RAND(1), Rand(1); +---------------------+---------------------+---------------------+ | RAND(1) | RAND(1) | Rand(1) | +---------------------+---------------------+---------------------+ | 0.40540353712197724 | 0.40540353712197724 | 0.40540353712197724 | +---------------------+---------------------+---------------------+ 1 row in set (0.00 sec)
The above is the detailed content of How to generate the same sequence of random numbers in MySQL?. For more information, please follow other related articles on the PHP Chinese website!