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: SQL

Re: SQL

From: Glen Siferd <siferd_at_admin.uwex.edu>
Date: Wed, 21 Jul 1999 09:46:33 -0500
Message-ID: <7n4mg9$rda$1@news.doit.wisc.edu>


Nope. This won't work. ROWNUM is assigned before ORDER BY, so you get the first 3 rows found, sorted.

Gary O'Keefe <gary_at_onegoodidea.com> wrote in message news:3795cec6.103845285_at_news.hydro.co.uk...
>
> Using Oracle (and why not, this is comp.databases.oracle.misc):
>
> SELECT *
> FROM emp
> ORDER BY salary DESC
>
> and for the second example:
>
> SELECT *
> FROM emp
> WHERE rownum <= 3
> ORDER BY salary DESC
>
> Tip: Get a copy of "ORACLE8: The Complete Reference" by George Koch
> and Kevin Loney (ISBN 0-07-88-2396-X, $59.99) from just about any book
> shop with a computing section. It's (IMO) the best and most complete
> Oracle book for a newbie, plus you'd never have asked the question if
> you'd read it.
>
> Tip 2: Don't you think that 8 question marks are a bit
> excessive???????? Don't you think that one on its own looks just a
> teensy bit more classy?
>
> Gary
> --
> Gary O'Keefe
> gary_at_onegoodidea.com
>
> You know the score - my current employer has nothing to do with what I
post Received on Wed Jul 21 1999 - 09:46:33 CDT

Original text of this message

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