oracle中的varchar2排序是如何工作的?
我正在按 Varchar2 列对 Oracle SQL 查询进行排序。但是当我得到结果时,我无法正确理解顺序。这是逻辑顺序。第一个小写字母?数字?符号?这里我附上其中一个测试的排序结果:
select FieldToOrder from MyTable order by FieldToOrder ASC
FieldToOrder
a VARCHAR2 列
FieldToOrder:
" 77777777777" //第一个字符是空格
"aaas"
"_aad "
"AADD"
"A00004AAAA9999"
"ref11"
"ref22"
"0000000002222"
关于逻辑顺序有什么想法吗?谢谢,
I'm sorting a Oracle SQL query by a Varchar2 column. But when I get the results i can not correctly understand the ordering. Which is the logical order. first lower letters? numbers? symbols?. Here I attach the resulting ordering of one of the tests:
select FieldToOrder from MyTable order by FieldToOrder ASC
being FieldToOrder
a VARCHAR2 column
FieldToOrder:
" 77777777777" //The first character is a blank space
"aaas"
"_aad"
"AADD"
"A00004AAAA9999"
"ref11"
"ref22"
"0000000002222"
Any ideas of what's the logical order? Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于客户端的环境变量
NLS_LANG
。请参阅有关NLS_SORT
的此参考< /a>.It depends on the environment variable
NLS_LANG
on your client side. See this reference onNLS_SORT
.