Skip to content
Advertisement

In MySQL, query of a word also matches words with special characters

The following query is supposed to match all comments containing ‘testa’, but it matches ‘testä’, as shown below:

How to do an exact match only for the string ‘testa’, so that it doesn’t show results for its matching special character?

Advertisement

Answer

I think I have a solution for you. You can use convert(column_name using latin1). Please check my code below=>

if you want to use COLLATE then MySql version should be 8.0 as Akina mentioned in the description.

Note : Please check the link dbfiddle

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement