| Jayanta |
Posted: Nov 16, 2006 03:47:51 PM |
Total Post: 479
Joined: Feb, 2006
|
Hello every body!
oracle study mat saying that " The subquery that defines the view can't contain an order by clause. The order by clause is specified when u retrieve data from the view."
but when i am issuing the following statements at the sql prompt with order by clause it is working just fine:
SQL> create or replace view emp
2 as select department_id,first_name from employees order by department_id desc;
View created.
SQL>
and the view named emp gets created with department_id column in desc order.
will any one please explain the reason why?? |
|
|
Vishal |
| Posted: Nov 17, 2006 04:22:49 AM | |
|
Total Post: 37
Joined: Mar, 2006
|
"SUBQUERY"----try using the same query as a subquery and then run...it should give error.
|
|
|
|
|
Jayanta |
| Posted: Nov 17, 2006 12:56:11 PM | |
|
Total Post: 479
Joined: Feb, 2006
|
hello vishal!
will u please give an example to make me understand better.
|
|
|
|
|
praveen |
| Posted: Nov 30, 2006 01:13:28 AM | |
|
Total Post: 11
Joined: Oct, 2006
|
u check this query
create or replace view as select dept_id,first_name from (select * from employee) order by dept_id desc;
and tell me the result.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |