Re: Why Oracle View can not use Order by clause in the View definition query ?...

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 11 May 1998 10:48:45 GMT
Message-ID: <3558d716.13773515_at_192.86.155.100>


A copy of this was sent to masyedkasim_at_hotmail.com (if that email address didn't require changing) On Mon, 11 May 1998 07:57:24 GMT, you wrote:

>Hi,
>
>I am using Oracle for more than four years.
>But I dont know the reason why Oracle view does not allow
>Order by clause in the View Query.
>Can you clarify it...
>
>By
>Syed Kasim.
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading

Because a view is a set, like a table. The rows in a table have no order, the rows in a view likewise have no order.

Lets say you could create a view with an order by. Say you created:

create view emp_v as select * from emp order by empno; [Quoted] [Quoted] create view dept_v as select * from dept order by deptno;

And then you ran the query:

select * from emp_v, dept_v where emp_v.empno = dept_v.deptno;

What would happen to the order by's since they conflict with eachother?  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon May 11 1998 - 12:48:45 CEST

Original text of this message