Each time you seed the generator with a given value, RAND( ) will produce a repeatable series of numbers:
mysql>
mysql> SELECT RAND(1), RAND( ), RAND( );
+-------------------+-------------------+-------------------+
| RAND(1) | RAND( ) | RAND( ) |
+-------------------+-------------------+-------------------+
| 0.405403537121977 | 0.460129410456987 | 0.438083880988959 |
+-------------------+-------------------+-------------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT RAND(20000000), RAND( ), RAND( );
+-------------------+-------------------+-------------------+
| RAND(20000000) | RAND( ) | RAND( ) |
+-------------------+-------------------+-------------------+
| 0.339101235698072 | 0.810031204307481 | 0.735904409304172 |
+-------------------+-------------------+-------------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT RAND(1), RAND( ), RAND( );
+-------------------+-------------------+--------------------+
| RAND(1) | RAND( ) | RAND( ) |
+-------------------+-------------------+--------------------+
| 0.405403537121977 | 0.249428464332063 | 0.0394291244814444 |
+-------------------+-------------------+--------------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT RAND(20000000), RAND( ), RAND( );
+-------------------+-------------------+-------------------+
| RAND(20000000) | RAND( ) | RAND( ) |
+-------------------+-------------------+-------------------+
| 0.339101235698072 | 0.448860260144677 | 0.126013958012698 |
+-------------------+-------------------+-------------------+
1 row in set (0.00 sec)
mysql>
Related examples in the same category