SQLite的那种特殊字符的字母顺序 [英] SQLite sort special characters alphabetically
本文介绍了SQLite的那种特殊字符的字母顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我建立用来教人们法语的应用程序。当我尝试整理一些法国的话不结束,我打算他们是,例如:
- 阿列尔
- Boire
- 连接
- 理由
- Vouloir
将按照以下顺序进行排序:
- 阿列尔
- Boire
- 连接
- Vouloir
- 理由
目前我使用的SQL语句是:
SELECT名字,assignment_id FROM GrammarAssignments ORDER BY名COLLATE NOCASE
解决方案
以防万一,另外一个人遇到这个职位,我碰到了同样的问题,并进行了测试。下面应该做视区域设置以及排序不区分大小写排序的把戏。
SELECT名字,assignment_id FROM GrammarAssignments ORDER BY名COLLATE属地化ASC
I'm building an application that is used to teach people French. When I try to sort some French words do not end up where I intended them to be, for example:
- Aller
- Boire
- En
- Être
- Vouloir
Will be sorted in the following order:
- Aller
- Boire
- En
- Vouloir
- Être
The SQL statement I'm currently using is:
SELECT name, assignment_id FROM GrammarAssignments ORDER BY name COLLATE NOCASE
解决方案
Just in case some one else comes across this post, I ran into the same issue and tested it. The below should do the trick of sorting depending on the locale as well as sorting case insensitive.
SELECT name, assignment_id FROM GrammarAssignments ORDER BY name COLLATE LOCALIZED ASC
这篇关于SQLite的那种特殊字符的字母顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文