I have MySQL db, db engine InnoDB, collation set to utf8-utf8_general_ci (also tried utf8_unicode_ci). I would like db to treat equaly č and c, ž and z, ć and c, š and s, đ and d.
E.g,
table1
-------------
id | name
-------------
1 | mačka
2 | đemper
-------------
if I run query:
SELECT * FROM table1 WHERE name LIKE '%mac%'
or
SELECT * FROM table1 WHERE name LIKE '%mač%'
I will get the result:
-------------
id | name
-------------
1 | mačka
Which is OK, that is exactly what I want.
But if run query:
SELECT * FROM table1 WHERE name LIKE '%de%'
I get zero results.
And if I run query:
SELECT * FROM table1 WHERE name LIKE '%đe%'
I will get:
-------------
id | name
-------------
2 | đemper
This is not behaviour that i would want nor expect. I would like that both (last two queries) returned:
-------------
id | name
-------------
2 | đemper
How can I accomplish this?
Any kind of help is appreciated, thanks in advance 🙂 !
This can’t be done without the use of regular expressions, as there is no collation in MySQL that considers
đequivalent tod.