Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Selecting Random record
Joseph Ranseth wrote:
>
> I am trying to create a random electronic draw.
> I need to select random records from a view(which pulls from 2 tables). I'd
> also like to give a user x number of bonus entries if a certain value is
> set.
>
> Any ideas or advice?
>
Since randomness is not an element of relational algebra, there is no direct way to retrieve random numbers through SQL.
On the other hand you could install the dbms_random package. The code is in $ORACLE_HOME/rdbms/admin/dbmsrand.sql.
Uwe
-- Uwe Schneider - WEB.DE AG - Amalienbadstr. 41 - 76227 Karlsruhe Forschung & Entwicklung - Tel. (+49) 721 94329 832 "In a world without walls and fences, who needs windows and gates?"Received on Fri Sep 22 2000 - 09:59:22 CDT