Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL problem
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
>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 CorpReceived on Fri Jun 29 2001 - 15:03:58 CDT