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: Display only part of resultset

Re: Display only part of resultset

From: Noel <tbal_at_go2.pl>
Date: Mon, 22 Dec 2003 08:50:41 -0000
Message-ID: <bs67jt$9oh$1@inews.gazeta.pl>

> ------------------------------------------
> SELECT nazev, psh1
> FROM (SELECT nazev, psh1 FROM vw_stk WHERE id_psh1=10 ORDER BY nazev)
> WHERE ROWNUM<=20;
> ------------------------------------------
> The problem is, that I can't take other records (only first ones) using
this
> technique (condition WHERE ROWNUM>20 AND ROWNUM<=40 can't work, because
> ROWNUM is just pseudocolumn created dynamically).

You can use rownum:

 SELECT nazev, psh1

     FROM (
         SELECT rownum rn, nazev, psh1
           FROM vw_stk
           WHERE id_psh1=10
       ORDER BY nazev) a
     WHERE A.RN <= 20;

--
Noel
Received on Mon Dec 22 2003 - 02:50:41 CST

Original text of this message

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