Home » SQL & PL/SQL » SQL & PL/SQL » New Issue in ORDER BY 10g
New Issue in ORDER BY 10g [message #238289] Thu, 17 May 2007 06:02 Go to next message
Messages: 55
Registered: November 2006
Location: Mumbai

I have found one discripency in the results from 9i and 10g in a query.


SELECT gtablecode2,
FROM answer_table
order by decode(ans_returned_chr,'AR',1,3);

OUTPUT in 10G:


FRE French QC
ENG English

OUTPUT in 91G:


ENG English
FRE French QC

The Ordering is showing different results... pls analyse

Re: New Issue in ORDER BY 10g [message #238295 is a reply to message #238289] Thu, 17 May 2007 06:18 Go to previous message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Well, your order by gives both of the rows the same value - you give 'AR' a value of 1 and everything else a value of 3.
So, as there is no defined order that they should appear in, you cannot guarantee the order they will appear in.

As there is no reason why rows from queries run on two different databases should come back in the same order, this is entirely expected behaviour, and doesn't even indicate that there has neccessarily been a change in the order by logic.

[Updated on: Thu, 17 May 2007 06:20]

Report message to a moderator

Previous Topic: Unix command through external procedure in C running successfully but showing no output.
Next Topic: functions
Goto Forum:

Current Time: Wed Oct 26 11:13:22 CDT 2016

Total time taken to generate the page: 0.07321 seconds