1

I would like do a select query using LIKE but MySQL replies with results having different characters, e.g.

select name FROM cities WHERE city LIKE "Muni%"

Results:

Múnic
Munic
Munich
Múnich

How do I eliminate results like Múnic and Múnich, so that just the entered characters are being matched?

JOhnlw009a
  • 1,012
  • 1
  • 7
  • 12
  • 1
    You could change the collation to `latin` on the search. Take a look to: https://stackoverflow.com/questions/8647080/accent-insensitive-search-query-in-mysql – Rumpelstinsk Sep 07 '17 at 09:20
  • 1
    Possible duplicate of [How to conduct an Accent Sensitive search in MySql](https://stackoverflow.com/questions/500826/how-to-conduct-an-accent-sensitive-search-in-mysql) – miracle_the_V Sep 07 '17 at 09:21
  • COLLATE utf8_bin did it. Thanks. Are there any performance issues when doing this in the query at runtime, especially when have a large cities DB ? – JOhnlw009a Sep 07 '17 at 09:25

0 Answers0