Select * but beetwen the 100th and 200th element

Select * but beetwen the 100th and 200th element

Post by Carlo Leorin » Thu, 02 Nov 2000 07:52:44



Hi,

I dont know how do get the elements of a table (with a select) but only
beetwen the 100th and the 200th for instance...

How to do that? Thank in advance for your help !

 
 
 

Select * but beetwen the 100th and 200th element

Post by Steve Blomele » Thu, 02 Nov 2000 21:05:28



> I dont know how do get the elements of a table (with a select) but only
> beetwen the 100th and the 200th for instance...

Carlo,

Let's say your starting query is this :

SELECT col1
FROM   some_table
ORDER BY col1

If you're only interested in rows 100 through 200 fetched by the
query then you could use this :

SELECT col1
FROM  (SELECT rownum mynum, col1
       FROM   some_table
       ORDER BY col1) mytab
WHERE  mytab.mynum BETWEEN 100 AND 200

HTH

Regards
Steve Blomeley

 
 
 

Select * but beetwen the 100th and 200th element

Post by tassili.tassil » Thu, 02 Nov 2000 23:53:10


Hi,

try this :

select *
  from t1
  where rownum <200
minus
select *
  from t1
  where rownum <100;

Bye

Tassili



Quote:> Hi,

> I dont know how do get the elements of a table (with a select) but only
> beetwen the 100th and the 200th for instance...

> How to do that? Thank in advance for your help !

 
 
 

Select * but beetwen the 100th and 200th element

Post by Carlo Leorin » Fri, 03 Nov 2000 05:25:10


Thank a lot !

--

_________________
NNNNNNNNNNNN
Pourquoi tant de N ?
____________
ICQ: 81656803


> Hi,

> try this :

> select *
>   from t1
>   where rownum <200
> minus
> select *
>   from t1
>   where rownum <100;

> Bye

> Tassili



> > Hi,

> > I dont know how do get the elements of a table (with a select) but only
> > beetwen the 100th and the 200th for instance...

> > How to do that? Thank in advance for your help !