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
  • 198,401
  • 62
  • 356
  • 264

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
  • 51
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
  • 29,338
  • 17
  • 103
  • 134
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,360
  • 2
  • 19
  • 14