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 records

Re: random records

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 12 Jul 2006 08:44:29 -0700
Message-ID: <1152719071.546235@bubbleator.drizzle.com>


Faby wrote:
> Hi, I have to select 50 random records from a table. How should i
> proceed? Should I use "sample", "dbms_random.value"...?
> Thanks

Use the SAMPLE clause ... that's what it was made for.

SELECT *
FROM t
SAMPLE(10); for example.

Demos in Morgan's Library at www.psoug.org under SELECT STATEMENTS.

-- 
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 Wed Jul 12 2006 - 10:44:29 CDT

Original text of this message

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