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: Filtered Query on nth row

Re: Filtered Query on nth row

From: Roy Varghese <rvarghese_at_ibm.net>
Date: 1998/02/06
Message-ID: <34DB5086.3540885F@ibm.net>#1/1

How about a simpler way:

SELECT columnA, columnB FROM
( SELECT ROWNUM Row#, columnA, columnB ) WHERE MOD( Row#, 5 ) = 0;

Dont forget to supply alias for column ROWNUM in the inline view !! Hope it helps.

Roy Varghese
email: rvarghese_at_ibm.net


Jeff Jackson wrote:

> Does anyone know how to do a query and filter every nth row ? Example,
> I have 100 rows returned but I am only intereseted in every other fith
> row for example.... row1, row6, row11,row16 etc.... I don't want to see
> rows 2,3,4,5,7,8,9,10 etc ... Is this possible ?
>
> Does SQL allow me to do this ? I have tried all kinds of queries,
> correlated, inner joins, sub queries and various expressions.
Received on Fri Feb 06 1998 - 00:00:00 CST

Original text of this message

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