Select random number from a list
- From: "Robert Scheer" <rbscheer@xxxxxxxxxxx>
- Date: 19 Apr 2006 08:20:53 -0700
Hi.
I have a table that will always have few records. In one of my
procedures I need to get the values from one of the fields of this
table, and randomly select one value from this list. This value will be
used to update a record on another table.
I am using Oracle 10g and read about the DBMS_RANDOM and
DBMS_RANDOMINTEGER but they can't help me, since I need to select a
value among a predefined list of values. Also, I tried the SAMPLE
clause, but there are times that the query returns no rows.
How can I code a procedure or function to return a random number from a
predefined list of values?
Thanks,
Robert Scheer
.
- Follow-Ups:
- Re: Select random number from a list
- From: Walt
- Re: Select random number from a list
- From: Mark D Powell
- Re: Select random number from a list
- Prev by Date: Re: TNS:listener could not resolve SERVICE_NAME given in connect descriptor
- Next by Date: Re: Pct Free, Pct Used.
- Previous by thread: can this be done more elegant?
- Next by thread: Re: Select random number from a list
- Index(es):
Relevant Pages
|