developer24hours
Thursday, April 18, 2013
MySQL generating a random integer between a min and a max
Say you want to generate a number between a and b, you can do the following:
select (FLOOR(a + RAND() * (b - a) ))
1 comment:
Hernaldo Gonzalez
May 22, 2014 at 2:58 PM
Very good, thanks!
Reply
Delete
Replies
Reply
Add comment
Load more...
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Very good, thanks!
ReplyDelete