如何在不使用区域设置的情况下对 unicode 字符进行排序?
我们有一个应用程序可以对用不同语言编写的字符串集进行排序。 问题是所有这些字符串都位于数据库中的同一列中,并且没有为这些字符串指定区域设置。 当我告诉我的同事,不使用区域设置信息就不可能对这些字符串进行排序时,我的同事们向我重复了一个问题“数据库如何为我们做同样的工作”? 有人可能有同样的问题,并且知道如何在不使用区域设置信息的情况下对 unicode 中的字符串进行排序的解决方案吗?第二个问题是绝对可以做到的吗?
We have an application which will sort the set of strings written in different languages.
The problem is that all of those srtings are located in a same column in a database, and there is no locale specified for those strings.
When I have told my colleagues that it is not possible to sort those strings without using locale information, my colleagues replay me with the question "how the database does the same jobs for us"?
May someone had a same problem and know the solution how to sort strings in unicode without using locale information? And second question is it absolute possible to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的数据库将有一个默认的排序规则,它将(除其他外)用于排序。
我相信实际上可以在查询期间指定排序规则 (虽然我不知道这会对性能产生什么影响)。
Your Database will have a default collation which will (amongst other things) be used for ordering.
I believe it is actually possible to specify the collation for ordering during a query (although I have no idea what performance hit this would have).