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: 424

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

Start a great career in Data Integration with Oracle Training and Certification Courses

Organizations today rely on data integration technologies in order to gain a unified view of data coming from disparate sources for informed and timely decision making. These technologies bring together data from multiple sources and transform them into meaningful and valuable information. Oracle is one of the leading providers of data integration technologies that are widely accepted by organizations all over the world. Oracle training and certification courses in the field of data…

Continue

Posted by Michael Warne on January 25, 2016 at 1:57am

Roll Forward Physical standby database in 12c

As you are aware that rolling forward a physical standby via an incremental SCN backup method is the simplest method of getting your standby database with lag into sync with the primary database. The lag can be due to missing archives on the primary which haven’t been shipped or applied on the standby.

 

With 12c, the roll forward technique is a bit different. In the prior versions, we had to initially take an incremental backup of the primary database from the SCN where the…

Continue

Posted by Shivananda Rao P on January 11, 2016 at 11:37pm

Learn IBM Sterling B2B Integrator Online Training at VirtualNuggets

VirtualNuggets is Offering Instructor Led Live IBM Sterling B2B Integrator Online Training. we are the Industry leader in providing IBM Sterling B2B Integrator Tools Training Services, Offering Corporate Trainings Both In Online and In-House and Online Training for Individuals. VirtualNuggets is Offering Online Training for all IT technologies across the globe. Our IBM Sterling B2B Integrator online training methodology focused on hands on experience of Sterling Integrator. We also arrange…

Continue

Posted by Vasu Buddi on October 9, 2015 at 11:25am

IBM Integration Bus Development Online Training

VirtualNuggets is Offering Instructor Led Live IBM Integration Bus Development. VirtualNuggets is the Industry leader in providing Integration Bus Tools Training Services, Offering Corporate Trainings Both In Online and In-House and Online Training for Individuals. VirtualNuggets is Offering Online Training for all IT technologies across the globe. Our IBM Integration Bus Development online training methodology focused on hands on experience of IBM Integration Bus Development. We also…

Continue

Posted by Vasu Buddi on October 6, 2015 at 4:13am

© 2016   Created by Steve Karam.   Powered by

Badges  |  Report an Issue  |  Terms of Service