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: nth record?

Re: nth record?

From: Alan D. Mills <alanmNOSPAM_at_uk.europe.mcd.mot.com>
Date: Fri, 9 Oct 1998 12:16:02 +0100
Message-ID: <6vkr8f$b29$1@schbbs.mot.com>


Maybe something like

SELECT *
FROM (SELECT col1, col2, ..., ROWNUM rec_num FROM tab1, tab2 WHERE .....) WHERE mod(rec_num, 5) = 0

I'm guessing at the MOD function to get every fifth record. Anyway, apply a function to rec_num to pick the records you actually want.

Of course, as ever, remember that ROWNUM is assigned BEFORE any sorting.

--
Alan D. Mills

Knez wrote in message <361CFE6A.C18BFB2B_at_justviewit.com>...
>Is there a way to grab the nth record, using Oracle? I would like to
>pull a specific number of records at random. Maybe, using every 5th,
>6th, 7th ect., record. Any suggestions.
>
>thank you...
>
Received on Fri Oct 09 1998 - 06:16:02 CDT

Original text of this message

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