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

Re: SQL problem

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 29 Jun 2001 13:03:58 -0700
Message-ID: <9himve01gd3@drn.newsguy.com>

In article <9him6s01cii_at_drn.newsguy.com>, Thomas says...
>
>In article <3B3CB6C4.E352DE3B_at_attws.com>, "Daniel says...
>>
>>Rok Kodrun wrote:
>>
>
>...
>
>>My understanding is that no version of Oracle has ever allowed an ORDER BY
>>clause in a view. The reason being that the ORDER BY belongs in the statement
>>selecting from the view.
>>
>>But having recently made two grevious mistakes here I wanted to be conservative
>>in my comment.
>>
>>Daniel A. Morgan
>>
>
>added in Oracle8i release 1:
>

sorry -- should have been a view exmaple:

scott_at_TKYTE816> create view V
  2 as
  3 select ename from emp order by ename;

View created.

scott_at_TKYTE816> select * from v;

ENAME



ADAMS
ALLEN
BLAKE
CLARK
FORD
JAMES
JONES
KING
MARTIN
MILLER
SCOTT
SMITH
TURNER
WARD 14 rows selected.

>scott_at_TKYTE816> select * from( select ename, sal from emp order by sal desc )
>where rownum < 4;
>
>ENAME SAL
>---------- ----------
>KING 5000
>SCOTT 3000
>FORD 3000
>
>--
>Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/
>Expert one on one Oracle, programming techniques and solutions for Oracle.
>http://www.amazon.com/exec/obidos/ASIN/1861004826/
>Opinions are mine and do not necessarily reflect those of Oracle Corp
>

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Fri Jun 29 2001 - 15:03:58 CDT

Original text of this message

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