Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Oracle Certified Professional Exams (OCP & OCA) >> confusing views!!!!!!!!!!!!!!!!

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: confusing views!!!!!!!!!!!!!!!!
 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

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar814
  Mohammed Taj694
  Jayanta Sur479
  Vigyan Kaushik386
  positive fanatic361
  Gitesh Trivedi322
  Gopu Gopi239
  neeraj sharma228
  Ramesh Jois226
  snehalatha p169






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software