| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Random first record returned
Melisa Mrazik wrote:
>
> From a set number of records in a table, HOTEL, a query will be sent with
> particular requirements (i.e. modern/historical, view/no-view, etc) and
> must return a matching set of records with the first record returned
> going to the application as the "preferred" hotel. If this same query
> with the same requirements is sent to the same table, a different first
> record must be returned to ensure randomness.
I can't understand the reason why you need that. Why can't you do by fetching through a cursor ? Why can't you recorded the selected record into a temp buffer or temp table ?
Anyway, if random is all you want, try :
SELECT * from (SELECT ROWNUM RN, T.* FROM T WHERE....) WHERE RN = :random_number Received on Fri Apr 04 1997 - 00:00:00 CST
![]() |
![]() |