weighted random value (1-10) e.g.3 will be 50 % of records
835234Oct 6 2011 — edited Oct 6 2011Hello,
i need to generate random values into my table. For the simplification, lets say that i need to generate values in range from 1 to 10. For this there is a lot of ways.
e.g. UPDATE test_number SET random_value = round (dbms_random.value (1,10))
But what I need is something like weighted random values. I need random values to be inserted into column, but I need e.g. 3 to be inserted more times than other values e.g. if i have 100 rows i want to have 3 in 50 random rows
Do you have any idea how to achieve it?
Thanks a lot for any help or reply !