Hi , 

in oracle 10 g , the below query results in alphabetical order , there is no order by caluse. but when i am running the same query in oracle 11g , it gives me in random order. what is the problem here?

select distinct  Report_137__1_ . COUNTRY_NM   COUNTRY_NM  from (select distinct  v . CTMS_TRIAL_ALIAS_CODE ,  v . CLINICAL_TRIAL_ID ,  c . GEO_BOUNDARY_ID ,  c . COUNTRY_NM ,  c . CANCEL_INDC ,  c . STOP_INDC  from  CTMS_CLINICAL_TRIAL_ID_V   v ,  TRIAL_COUNTRY_V   c  where  v . CLINICAL_TRIAL_ID = c . CLINICAL_TRIAL_ID )  Report_137__1_

 

above is a  simple select statement. Thanks much.

Tags: PL/Sql, by, clause, order

Views: 345

Reply to This

Replies to This Discussion

The problem is simple: The query does not have an ORDER BY clause.

If you want Oracle to guarantee a specific order of a result set *every time you run a query* you have to use an ORDER BY.

But does this means in 10g we do not need to mention order by clause and still we get the result in alphabetical order i.e. ascending order.i understand that we need to mention order by clause to get the result in asc/desc order.

but why here in 10g i am getting the result in asc order without mentioning the order by clause and in 11g m not.

does 10g ,11g have diff in sorting the result set?

 

This means that the query's optimizer plan in 11g is not the same as 10g.

I suggest you read this blog post by Tom Kyte: http://tkyte.blogspot.com/2005/08/order-in-court.html

Thanks a lot , this does help. hope i would be able to make business user understand this ;) 

RSS

Oracle Community On

I'm not a fan of advertising, and so I will not be including any advertisements on OracleCommunity.net. However, managing this community does not come without cost! If you are willing to donate to help pay for the monthly community fees and domain services I accept Bitcoin and PayPal donations.

Donate Bitcoins

Badge

Loading…

Blog Posts

What Benefits Does an MCSE Certification Carry?

MCSE certifications are the most popular certifications around the world. And, their popularity isn't without reason. In the following post I have highlighted the benefits that you can derive from an MCSE certification, so as to help you gauge how useful it can be for your career. Read on to know.…

Continue

Posted by Michael Warne on May 28, 2015 at 1:32am

Default Login Form customize

Dear All, I want to customize oracle 10g default login page. How can I do this. I attached the login page for better understanding.

Posted by Shakaouth Shanto on May 19, 2015 at 10:00pm

Live SAP Hybris Online Training Classes at VirtualNuggets

Web URL      :  http://www.virtualnuggets.com/sap-hybris.html

Email              :  info@virtualnuggets(dot)com

Contact           :  +1-7076668949(USA)         +91-8885560202(India) 

 

Live SAP Hybris Online Training Classes at VirtualNuggets

 

SAP Hybris is a standout amongst the most widely recognized e-commerce platforms       on the Internet…

Continue

Posted by Vasu Buddi on May 12, 2015 at 11:14pm

TIBCO BE Online Training

TIBCO BE Online Training

                                          

            We are Glad To Announce That TIBCO BE Online Training Offered by Industry real time Experts at VirtualNuggets Institute. we are offering TIBCO BE Online Training with a customized course design, The Learners who participate in our online training sessions will able to easily grab the required skills of TIBCO BE Which needed to solve integration challenges in real…

Continue

Posted by Vasu Buddi on May 6, 2015 at 11:27pm

© 2015   Created by Steve Karam.

Badges  |  Report an Issue  |  Terms of Service