作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Postgres 中对挪威文本列进行排序时遇到问题。
我的环境:
db=# select version();
PostgreSQL 9.2.14 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4), 64-bit
>locale
我得到的命令:
db=#\l
Name | Owner | Encoding | Collate | Ctype | Access privileges
-------------------------+--------------+----------+-------------+-------------+-----------------------
db | myadminUser | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
db=# select * from unnest(ARRAY['a','b','c','d','A','B','C','å','ø','z','Z','Ø']) as t1 order by t1;
db=# CREATE COLLATION nor (LOCALE = 'nn_NO.utf8');
db=# select * from unnest(ARRAY['a','b','c','d','A','B','C','å','ø','z','Z','Ø']) as t1 order by t1 collate nor;
db=# select * from unnest(ARRAY['aaaa','bbbb','cccc','dddd','AAAA','BBBB','CCCC','åååå','øøøø','zzzz','ZZZZ','ØØØØ']) as t1 order by t1 collate nor;
最佳答案
顺序是正确的。在挪威语中,“aa”是“å”的拼写,它应该放在最后。
来源:https://en.wikipedia.org/wiki/%C3%85
Correct alphabetization in Danish and Norwegian places Å as the lastletter in the alphabet, the sequence being Æ, Ø, Å. This is also truefor the alternative spelling "Aa". Unless manually corrected, sortingalgorithms of programs localised for Danish or Norwegian will placee.g., Aaron after Zorro.
关于postgresql - 如何在 Postgres 上对挪威文本进行排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34154030/
我是一名优秀的程序员,十分优秀!