Created
August 16, 2014 07:41
-
-
Save asika32764/534ad8891a2a3bb8fe05 to your computer and use it in GitHub Desktop.
Mysql Rand() between 2 values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROUND((RAND() * (max-min))+min) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Really, 1 repository for 1 buggy code line?
For range
(min..max(
(min inclusive, max exclusive) it is:FLOOR( RAND() * (max-min) + min )
For range
(min..max)
(min+max inclusive) it is:FLOOR( RAND() * (max-min+1) + min )