在 MySQL 中订购非英文字母 [英] Ordering non-english letters in MySQL

查看:67
本文介绍了在 MySQL 中订购非英文字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一位客户刚刚向我发送了以下关于订购他们信件的信息.他们来自芬兰.

I have a client who just sent me the following in regards to order their letters. They are from Finland.

在我们的字母表中,字母 å、ä 和 ö 位于字母表的最后.因此,以那些开头的名字也应该在字母 z 之后,而不是在a"或o"之下.

In our alphabet the letters å, ä and ö are at the very end of the alphabet. Therefore names starting with those should also be after the letter z, not under "a" or "o".

这是我第一次听说.有没有办法可以使用 MySQL 将这些字母显示在按字母顺序排列的列表的末尾?

This is the first I've heard of this. Is there a way I could make these letters show at the end of a alphabetical list using MySQL?

推荐答案

那大概就是那个表的校对规则是utf8_general_ci.试试这个,

That's probably the collation of that table is utf8_general_ci. Try this,

SELECT..
FROM..
WHERE..
ORDER BY text COLLATE utf8_bin

  • SQLFiddle 演示(utf8_bin 与 utf8_general_ci)立>

    • SQLFiddle DEMO (utf8_bin vs utf8_general_ci)
    • 这篇关于在 MySQL 中订购非英文字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆