Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select random number from a list
Here is one idea for you to consider: Load the data into a pl/sql table
(array) and use dbms_randon to generate a value used as the key into
the pl/sql table.
If the randomization of the selected data did not have to be truely randon you could substitute the seconds since midnight for a randon number as the input to the array slot selection.
Note both suggestions above will require distributing the return value into your number of array buckets, but allocating randon numbers into a range of desired values is a pretty standard operation. You can use MOD for this.
HTH -- Mark D Powell -- Received on Wed Apr 19 2006 - 10:37:05 CDT