MySQL - 为什么德语 ß 的 LIKE 运算符会忽略 COLLATION 规则?特点
我正在 MySQL 5.0.88 上使用 utf8 字符集和 utf8_unicode_ci 排序规则运行以下 select 语句:
SELECT * FROM table WHERE surname = 'abcß';
+----+-------------------+------+
| id | forename | surname |
+----+-------------------+------+
| 1 | a | abcß |
| 2 | b | abcss |
+----+-------------+------------+
SELECT * FROM table WHERE surname LIKE 'abcß';
+----+-------------------+------+
| id | forename | surname |
+----+-------------------+------+
| 1 | a | abcß |
+----+-------------+------------+
根据 http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html 德国特殊字符 ß = utf8_unicode_ci 的 ss ,但为什么它只适用于“=”运算符而不适用于 LIKE?我有一个电话簿应用程序,我迫切需要这两个应用程序一起工作。
I'm running the following select statements on MySQL 5.0.88 with utf8 charset and utf8_unicode_ci collation:
SELECT * FROM table WHERE surname = 'abcß';
+----+-------------------+------+
| id | forename | surname |
+----+-------------------+------+
| 1 | a | abcß |
| 2 | b | abcss |
+----+-------------+------------+
SELECT * FROM table WHERE surname LIKE 'abcß';
+----+-------------------+------+
| id | forename | surname |
+----+-------------------+------+
| 1 | a | abcß |
+----+-------------+------------+
According to http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html the german special char ß = ss for utf8_unicode_ci, but why does it only work with the "=" operator and not with LIKE? I have a phone book application and I desperately need both things working together.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来源:http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like
Source: http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like