Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Problem with SQL-Statement

Re: Problem with SQL-Statement

From: Klaus Zeuch <KZeuchnospam_at_hotmail.com>
Date: Fri, 4 May 2001 15:39:30 +0200
Message-ID: <9cuf36$857$1@papyrus.erlm.siemens.de>

<devnull50_at_yahoo.com> schrieb in im Newsbeitrag: 9cu45a$dle$1_at_news.netmar.com...
> Oracle's handbook is correct. Why not form the statement like...
>
> select * from xyz where rownum < 10 order by ident_column;
>
> This should give you the same result.
>

Normally not (except the table has only 9 records)! You retrieve the first 9 rows of the [unsorted] table and sort them by the value of ident_column. But the desired result were the 9 rows with the highest/lowest value of ident_column (described as TOP-n query in the Oracle 8i manual) -> sort all records by ident_column and retrieve the first 9 records from the sorted records.

Klaus Received on Fri May 04 2001 - 08:39:30 CDT

Original text of this message

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