Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: nth record?
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