Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How does one generate random integers; first 5 values occur 2 times more than later values

1042286Sep 21 2013 — edited Sep 22 2013

for the following code, how can I get the first 5 values to occur twice as often as the last 5 values?

Do I have to use nested loops?

Begin

  For n in 1 .. 10

  Loop

     dbms_output.put_line (ROUND(dbms_random.value(1, 10)));

End Loop;

End;

/

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2013
Added on Sep 21 2013
10 comments
1,405 views