Saturday, May 1, 2010

MySQL random integer in the range

To obtain a random integer R in the range i <= R < j, use the expression FLOOR(i + RAND() * (j – i)).

No comments:

Post a Comment