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

Home -> Community -> Usenet -> c.d.o.misc -> Re: reading random records with JDBC?

Re: reading random records with JDBC?

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 05 Nov 2007 09:27:21 -0800
Message-ID: <1194283637.797609@bubbleator.drizzle.com>


MfwEwkCtzVem_at_spammotel.com wrote:

>> Use the SAMPLE clausehttp://www.psoug.org/library.html
>> scroll down to "SAMPLE CLAUSE."

>
> Thank you very much for your good idea!
> But I did not tell the whole truth: I want to read random records from
> two tables and compare them. So I read record 883 from table1 and
> record 883 from table2 and compare the fields. Then I continue with
> another record.
>
> Martin

Then use DBMS_RANDOM to generate random numbers between 1 and the number of rows in the smallest of the two tables.

http://www.psoug.org/reference/dbms_random.html

alternatively DBMS_CRYPTO.RANDOM_INTEGER http://www.psoug.org/reference/dbms_crypto.html

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Mon Nov 05 2007 - 11:27:21 CST

Original text of this message

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