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: Amine Tarhini <atarhini_at_iglobal.net>
Date: 1998/02/10
Message-ID: <01bd362d$a0ca90a0$0f8d3b82@amine.iglobal.net>#1/1

You can use in_line views, as in:

SELECT col1, col2, col3 ...etc.
FROM (SELECT rownum row_num, col1, col2, col3 ...etc.

      FROM table_name
      WHERE where_clause
      GROUP BY group_by_clause
      etc...)

WHERE MOD(row_num,5) = 1

Hope this helps,
Amine

Donald Bowles <dbowles_at_praca.ksc.nasa.gov> wrote in article <6bf9fp$c2d_at_niven.ksc.nasa.gov>...
>
> Jeff Jackson wrote in message <34DA5954.3346_at_tatca.tc.faa.gov>...
> >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 Tue Feb 10 1998 - 00:00:00 CST

Original text of this message

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