0

I've been worndering why this query returns this result:

SELECT direccion_principal
FROM tb_dysport_contacto_medico_terapeutica
WHERE direccion_principal LIKE '%Ú%'

Result:

+---------------------+
| direccion_principal |
+---------------------+
| COLSANITAS          |
+---------------------+

The table collation is utf8_general_ci.

Cristian
  • 196,304
  • 62
  • 355
  • 262

3 Answers3

2

Before a query, indicate what charset the client will use to send SQL statements to the server with:

SET NAMES 'utf8';
Ain Tohvri
  • 2,987
  • 6
  • 32
  • 48
2

This part of your query:

LIKE '%Ú%'

is attempting to select results with accented characters. The utf8_general_ci collation removes accents: What are the diffrences between utf8_general_ci and utf8_unicode_ci?

Community
  • 1
  • 1
Chris Laplante
  • 28,754
  • 17
  • 99
  • 133
0
SELECT direccion_principal
FROM tb_dysport_contacto_medico_terapeutica
WHERE direccion_principal LIKE '%Ú%' collate utf8_bin

But this also makes it case sensitive.

ceteras
  • 3,290
  • 2
  • 18
  • 13