Re: How to limit # of rows returned by SELECT

From: Donna Kray <kray.donna_at_mlink.motors.ge.com>
Date: 1996/02/09
Message-ID: <4ffn85$me7_at_crissy.ge.com>#1/1


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 Fri Feb 09 1996 - 00:00:00 CET

Original text of this message