0

I'm trying to search in some fields that are stored as a JSON in a Mysql Database and have a problem with cute and acute symbols.

If I do a LIKE search in a text field, the behavior is that the two queries will return a match.

SELECT "match" AS name from table WHERE "cómo se hace" LIKE '%como%'

SELECT "match" AS name from table WHERE "como se hace" LIKE '%como%'

But if i do a search inside a JSON encoded field this behaviour is not consistent:

SELECT "match" AS name FROM table WHERE JSON_UNQUOTE(JSON_EXTRACT('{"es": "cómo name"}','$.es')) LIKE '%como%';

This query will not find matches with cute symbol in o (ó). The next one will find the match.

SELECT "match" AS name FROM table WHERE JSON_UNQUOTE(JSON_EXTRACT('{"es": "cómo name"}','$.es')) LIKE '%cómo%';

Why LIKE keyword is behaving this way in this case and how I can make it behave with the 'default' behavior?

Thomas G
  • 9,886
  • 7
  • 28
  • 41
mad93
  • 26
  • 3

0 Answers0