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: get x number of records from the table

Re: get x number of records from the table

From: Anatoly Moskovsky <avm_at_trais.com.ua>
Date: Wed, 19 Sep 2001 15:46:30 +0300
Message-ID: <TRS16876B48A@trais.com.ua>


Hi!

 CN> varchar2(100));", and some records inserted in the table tab, To get  CN> the records between 30-60, you may issue the next statement:

 CN> select val from
 CN> (select val from tab order by val)
 CN> where rownum <30
 CN> minus
 CN> select val from
 CN> (select val from tab
 CN> order
 CN> by 1)
 CN> where rownum <=60
 CN> /

select val
  from
(

    select val, rownum row_num
      from
    (

        select  val
          from tab
         order by val

    )
)
where row_num between 30 and 60

Bye



Anatoly Moskovsky, Oracle Developer avm_at_sqlbatch.com [SQL Batch/Oracle, DBA tools, reverse engineering, scripting extensions]: http://sqlbatch.com/sb/ Received on Wed Sep 19 2001 - 07:46:30 CDT

Original text of this message

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