RAND()
RAND([seed])This function returns a random floating-point number from 0 to 1. A seed number may be passed as an argument to start the sequence of random numbers at a different point. Here is an example:
SELECT RAND( ), RAND( ); +------------------+------------------+ | RAND( ) | RAND( ) | +------------------+------------------+ | 0.29085519843814 | 0.45449978900561 | +------------------+------------------+
Note that rerunning this statement with the same seed will produce the same results. This type of sequence is properly known as a pseudorandom number generator, and is generally not considered strong enough for security purposes, but it is adequate for making random choices among a set of alternatives.