当使用整数参数调用时,RAND()使用该值作为随机数生成器的种子。每次为生成器提供给定值时,RAND()将产生相同的随机数序列。以下示例将演示它-
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)