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

Home -> Community -> Mailing Lists -> Oracle-L -> Random data retrieval

Random data retrieval

From: Sachin Puri <sachin_at_siworldwide.com>
Date: Fri, 12 Jan 2001 15:03:04 +0530
Message-Id: <10739.126473@fatcity.com>


Consider a table A :

LesseeID                      BidRate
100                            2.4
101                            2.5
102                            3.5
103                            2.4
104                            2.4

Now I want to retrieve LesseeId with minimum BidRate however please note that I just need a single LesseeID and that too randomly. Now if I use :
select LesseeID from A where BidRate = (select min(BidRate) from A); The output is :
LesseeID



100
103
104

My Question:
Does anyone knows how to write a query or any pl/sql block in order to retrieve only one LesseeID and that too randomly so i can get only a single LesseID and that single LesseeID should be changing each time i use the query or block .
Please note that I don't want to use 'dbms_random' . I have actually written a pl/sql block that works perfectly fine however i want to have it done in a single query or may be by using small piece of code.

Rgds,
Sachin Puri
Oracle Development and Administration Received on Fri Jan 12 2001 - 03:33:04 CST

Original text of this message

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