开发者

Android sqlite: order by to sort international characters

开发者 https://www.devze.com 2023-01-19 11:04 出处:网络
I have a android database and it has a column called \'name\'.\'Name\' column can have international characters. Now when I query this database, I want to sort the name column. The sort should conside

I have a android database and it has a column called 'name'.'Name' column can have international characters. Now when I query this database, I want to sort the name column. The sort should consider international characters while sorting. I have read that there is a UNICODE collator for a开发者_如何转开发ndroid but I am not able to use it in queries. Anybody has an idea how to use UNICODE collator. Can I really use UNICODE collator for sorting ? Any pointers will be appreciated.


Try these:

SELECT name FROM table ORDER BY name COLLATE LOCALIZED

or

SELECT name FROM table ORDER BY name COLLATE UNICODE
0

精彩评论

暂无评论...
验证码 换一张
取 消