Actually, ROUND((RAND() * (max-min))+min)
is the best way in MySQL to do what you'd like. It is also the best way in ActionScript, JavaScript, and Python.
So for example you want an integer between 1 and 9:
9 - 1 + 1
gives you 9RAND() * 9
gives you a float between 0 (inclusive) and 9 (excluded)FLOOR(...)
converts the previous result to an integer between 0 and 8 (both inclusive)- Adding 1 to previous result gives you an integer between 1 and 9 (both inclusive)