Re: How to limit # of rows returned by SELECT

From: Ken Ingram <kingram_at_interramp.com>
Date: 1996/02/13
Message-ID: <4fp2e0$et_at_usenet6.interramp.com>#1/1


A more flexible alternative is to use a pl/sql cursor loop where you can order by whatever you want and only fetch as many rows as the loop is set up for.

Ken Ingram
Metasys Inc

In article <4fo53t$rv7_at_concorde.ctp.com>, gumak_at_ctp.com says...
>
>In PowerBuilder, you can use RETRIEVE_AS_NEEDED to retrieve
>one full page of data at a time. Other front-ends may have a similar
>feature.
>Umakanth
>gumak_at_ctp.com
>517-346-7109
>
>Donna Kray <kray.donna_at_mlink.motors.ge.com> wrote:
>
>>dischner_at_med.uni-muenchen.de (Anton Dischner) wrote:
>>>Hi Gordon,
>>>
>>>try select * from <your_table> where rownum < 11;
>>>
>>>for the first ten items.
>>>Note that the rownum is calculated last, so any other where clauses with
>>>rownum will probably not work.
>>>
>>==================================================================
 

>>Incorrect.ROWNUM with other WHERE clauses will work. ROWNUM is calculated
>>as records are retrieved from the table, as determined by where
>>conditions, if they exist. ROWNUM is calculated *before* the ORDER BY is
>>evaluated, so an ORDER BY can ( & probably will) un-order the ROWNUM
>>values.
 

>>DL Kray
>
>
>
Received on Tue Feb 13 1996 - 00:00:00 CET

Original text of this message