本文共 825 字,大约阅读时间需要 2 分钟。
彼得,
排序的行为由NLS_SORT会话参数调节,而比较的行为取决于NLS_COMP参数.你必须有不匹配.
我获得与使用以下参数相同的结果:
sql> SELECT *
2 FROM nls_session_parameters
3 WHERE parameter IN ('NLS_COMP','NLS_SORT');
PARAMETER VALUE
------------------------------ ----------------------------------------
NLS_SORT FRENCH
NLS_COMP BINARY
但是当两者匹配时,结果是一致的:
sql> alter session set nls_comp=LINGUISTIC;
Session altered
sql> select * from (
2 select '000000000000' as x from dual
3 union
4 select '978123456789' as x from dual
5 union
6 select 'B002AACD0A' as x from dual
7 ) /*where x>'000000000000'*/ order by x;
X
------------
B002AACD0A
000000000000
978123456789
sql> select * from (
2 select '000000000000' as x from dual
3 union
4 select '978123456789' as x from dual
5 union
6 select 'B002AACD0A' as x from dual
7 ) where x > '000000000000' order by x;
X
------------
978123456789
转载地址:http://bhlyo.baihongyu.com/