Looking for case insensitive MySQL collation where “a” != “ä”

天大地大妈咪最大 提交于 2019-11-29 15:14:49

My recommendation would be to use utf8_bin and in your WHERE clause, force both sides of your comparison to upper or lower case.

It works fine here with utf8_german2_ci as collation:

SELECT * FROM tablename WHERE fieldname LIKE "würz%" COLLATE utf8_german2_ci
BjeMTj

I checked utf8_bin like this

CREATE TABLE tmp2 (utf8_bin VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_bin);
INSERT INTO tmp2 VALUES ('nói');

select * from tmp2 where utf8_bin='noi';

You could try utf8_swedish_ci, it's both case insensitive and distinguishes between a and ä (but treats e.g. ü like y).

Collations are language-dependent, and it seems German doesn't have its own collation in MySQL. (I had a look at your profile, which says you're German.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!