Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL:Getting the 'Nth' records from a table..
I don't know why you want to do it, but try :
SELECT * FROM (SELECT ROWNUM xyz, Col1, Col2, Col3 FROM tablename)
WHERE MOD(xyz,5)=1
This will get Record 1, 6, 11 ...
Ted
On Fri, 24 Sep 1999 18:03:54 GMT, narayana_ck_at_my-deja.com wrote:
>I need to write a SQL query which can get the records from a table with
>a frequency of 'n'.
>
>Retrieve the 1st, 5th, 10th, 15th, 20th, 25th...
>rows from a table.
>
>Is there a way to get it straight from SQL??
>
>thanks
>ck
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
EMail: knijff_at_bigfoot.com Received on Sun Sep 26 1999 - 04:08:06 CDT
![]() |
![]() |