I need an SQL command that generates a random number between 1 and 11, and for number 1 to be generated more frequently than the others.
I currently use the following command:
FLOOR(1 + (RAND() * 11))
It is in a SQL WHERE command, example:
WHERE numero < FLOOR(1 + (RAND() * 11))
This WHERE is in a SQL command, which is executed in a procedure and that runs every second, that is, every second a different number is generated.
The problem is that this command generates the numbers randomly, without the rule of number 1 more often.
How can I change this command so that it randomly manages the numbers and that number 1 is generated more frequently?