Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle-l »

RE: order by clause in a view

Reidy, Ron

2007-08-07


Why not:
 
select * from view
order by col;
 
Instead of putting the order by in the view definition?
 
And, don't you have to alias the count(cust_no) expression?
 
Ron Reidy
Lead DBA
 


From: oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.org] On Behalf Of Lyall Barbour
Sent: Tuesday, August 07, 2007 3:18 PM
To: oracle-l@freelists.org
Subject: order by clause in a view

Hi,
  Simple question.  I've got a solution.  Hoping you peeps could come up with a better one.
 
select cust_no, count(cust_no)
from table
where <blah>
group by cust_no
order by count(cust_no)
 
works great.
 
create or replace view <table_v> as
select cust_no, count(cust_no)
from table
where <blah>
group by cust_no
order by count(cust_no)
 
some ora error
 
We are running 8.0.5 and that's why.  8i it's fixed.  I'm prepared to create a temp table and truncate it after my report goes.  But was hoping you guys might have another way to do this....
 
Thanks,
Lyall Barbour

--
We've Got Your Name at Mail.com
Get a FREE E-mail Account Today - Choose From 100+ Domains

This electronic message transmission is a PRIVATE communication which
contains information which may be confidential or privileged. The
information is intended to be for the use of the individual or entity
named above. If you are not the intended recipient, please be aware that
any disclosure, copying, distribution or use of the contents of this
information is prohibited. Please notify the sender of the delivery
error by replying to this message, or notify us by telephone
(877-633-2436, ext. 0), and then delete it from your system.

©2008 dba.5341.com - Jax Systems, LLC, U.S.A.