I want to use SQL's RAND()
-function to get the number 400, 450 or 500 and insert it in a field inside a tabe.
How could I do that?
I want to use SQL's RAND()
-function to get the number 400, 450 or 500 and insert it in a field inside a tabe.
How could I do that?
I think you can follow code bellow
a = floor(rand() * 3);
value = 400 + a*50;
First genterate ints from set [0,1,2] then multiple to 50 to get step in 50 then add seed
select floor(rand() * 3) * 50 + 400