Order by having different result

Hello,

maybe a noob's question but ...

i m running the following request in two different version of toad and the result is different , is it a setting in toad ? ( with sql+ the result is same)

with tab as (
select '3' from dual
union select 'b' from dual
union select 'C' from dual
union select 'a' from dual
union select '1' from dual
)
select * from tab order by 1;

Toad 10.1.1.8
a
b
C
2
3

Toad 13.0.0.80
1
3
C
a
b

sql+

1
3
C
a
b

does anyone have an idea about that ?

I guess in 10.1.1.8 you meant to have 1 and 3, not 2 and 3? The results don't match the SQL.

That aside, if you ran in a different database, or in the same database but with different NLS SORT parameters (which could be set at database or session level), you could get different results.

There's some info on NLS SORT here php - How to sort by numbers first with Oracle SQL query? - Stack Overflow.

This is a database setting, not a Toad setting, but you can see what it is set to here:

Hi John,
thanks a lot , yet it's correct it's 1 and 3.

i guess this is a question of session because it s runing on the same database.

I guess another possibility is that in Toad, maybe a column header was clicked (in the grid) . You can sort in Toad by clicking column headers.

Hi John ,

thanks again , it was totally correct and i was able to update it .

1 Like