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: replace this with _at_ <_at_)xs4all.nl>
Date: Thu, 08 Oct 1998 19:46:35 GMT
Message-ID: <361d15d9.9042832@news.xs4all.nl>


Hi,

>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.

Use a cursor, example:

declase
  cursor c1 is ;
begin
  for r1 in (select * from your_table) loop     if mod(c1%rowcount,7) = 0 then
      do_your_thing
    end if;
  end loop;
end;

You can also use a (semi-) random function. Those are posted here regularly.


Received on Thu Oct 08 1998 - 14:46:35 CDT

Original text of this message

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