Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Random first record returned

Re: Random first record returned

From: Michael Ho <infoage_at_hk.super.net>
Date: 1997/04/04
Message-ID: <3343DCA6.21CB@hk.super.net>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US