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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: help with query :)

Re: help with query :)

From: Tanveer Inamdar <tanveer_inamdar_at_yahoo.com>
Date: Sat, 3 Jun 2000 08:32:09 +0530
Message-Id: <10516.107637@fatcity.com>


Abdul Aleem I Think Serge is right as rownum is executed before orderby and not afterwards

> This_is_strange, because I have tried the following two queries on the
Scott
> demo table Emp and it worked. Let's see what Yohans says from his
> experience.
>
> Regards,
>
> Aleem
>
> Following is the result from both queries.
>
> SELECT EmpNo FROM Emp ORDER BY EmpNo DESC
> EMPNO
> ----------
> 7934
> 7902
> 7900
> 7876
> 7844
> 7839
> 7788
> 7782
> 7698
> 7654
> 7566
> 7521 In the second query
> 7499 In the second query
> 7369 In the second query
>
> SELECT EmpNo FROM Emp WHERE ROWNUM <= 3 ORDERY BY EmpNo DESC
>
> EMPNO
> ----------
> 7521
> 7499
> 7369
>
>
> -----Original Message-----
> From: Serge Kosourikhin [mailto:kosour_at_braz.ru]
> Sent: 02 June, 2000 2:22 PM
> To: Multiple recipients of list ORACLE-L
> Subject: Re: help with query :)
>
> It _shuldn't_ work, because ROWNUM works before order by, not after.
>
> Serge Kosourikhin
> Oracle DBA
> JSC Bratsk Aluminium Plant
> ----- Original Message -----
> To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
> Sent: Friday, June 02, 2000 4:44 PM
>
>
> > I think excellent, It should work.
> >
>
> --
> Author: Abdul Aleem
> INET: abchaudhary-ho_at_beaconhouse.edu.pk
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).



Do You Yahoo!? Received on Fri Jun 02 2000 - 22:02:09 CDT

Original text of this message

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