Question: I want to get random number between 65 to 122.I am using this query   

```
SELECT (FLOOR(65 + RAND() * 122));

```

after getting help from [this question](https://stackoverflow.com/questions/14865632/mysql-update-with-random-number-between-1-3) but it is giving me numbers outside the range of 65-122.  

Please help.Thanks

Answer: 
```
SELECT (FLOOR(65 + RAND() * 57));

```

Rand provides a number between 0-1. Like 0,75.
So if you want to get a number betwen 65 and 122 then:

```
65 = 65+0*57
122 = 65+1*57

```
I think what you want is 

65 + FLOOR( RAND() \* 57 )

a minimum of 65 PLUS random of 0-57, so at the high end, 65 + 57 = 122