|
|
|
|
|
|
| Author |
Message |
DA Morgan *nix forums Guru
Joined: 06 Mar 2005
Posts: 1042
|
Posted: Mon Feb 28, 2005 4:03 pm Post subject:
Re: Can we use ORDER BY in view?
|
|
|
Mark D Powell wrote:
| Quote: | What version of whose student guide do you have? Order by clauses in
views were not supported back in version 7, but this restriction has
been lifted. I do not remember the exact version when Oracle lifted
this restriction; it may have been with one of the 8.1 versions.
However, order by clauses should appear in views only where necessary
to create the correct result set. In the majority of cases the final
set ordering should be specified with the query on the view.
Someone else might remember the version where this changed but with 9.2
it is legal.
HTH -- Mark D Powell --
|
At issue here is Couchman's book. Couchman may know Oracle but his
editors didn't do him a service when they took his 8i book and tried
to relabel it as 9i.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace 'x' with 'u' to respond) |
|
| Back to top |
|
 |
DA Morgan *nix forums Guru
Joined: 06 Mar 2005
Posts: 1042
|
Posted: Mon Feb 28, 2005 3:42 pm Post subject:
Re: Can we use ORDER BY in view?
|
|
|
dd wrote:
| Quote: | Can we use ORDER BY clause in view's definition:
CREATE OR REPLACE VIEW a_v as
select * from a order by 1;
According to Oracle's Student Guide, this is not allowed. But, by my
testing with 9iR2, it is allowed. So what is the exact rule?
|
The Student Guide has many many errors. That is one of many reasons why
it is of limited if not negative value.
Another error is the claim that:
SELECT deptno, avg(sal), job
FROM emp
GROUP BY deptno;
isn't valid: It is.
And there are at least 50 more.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace 'x' with 'u' to respond) |
|
| Back to top |
|
 |
Mark D Powell *nix forums Guru
Joined: 23 Apr 2005
Posts: 701
|
Posted: Mon Feb 28, 2005 2:06 pm Post subject:
Re: Can we use ORDER BY in view?
|
|
|
What version of whose student guide do you have? Order by clauses in
views were not supported back in version 7, but this restriction has
been lifted. I do not remember the exact version when Oracle lifted
this restriction; it may have been with one of the 8.1 versions.
However, order by clauses should appear in views only where necessary
to create the correct result set. In the majority of cases the final
set ordering should be specified with the query on the view.
Someone else might remember the version where this changed but with 9.2
it is legal.
HTH -- Mark D Powell -- |
|
| Back to top |
|
 |
dd *nix forums beginner
Joined: 08 Jun 2005
Posts: 14
|
Posted: Mon Feb 28, 2005 11:20 am Post subject:
Can we use ORDER BY in view?
|
|
|
Can we use ORDER BY clause in view's definition:
CREATE OR REPLACE VIEW a_v as
select * from a order by 1;
According to Oracle's Student Guide, this is not allowed. But, by my
testing with 9iR2, it is allowed. So what is the exact rule? |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 6:00 am | All times are GMT
|
|
Secured Loans | Customer services | Problem Mortgage | Credit Cards | Credit Card Application
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|