views:

35

answers:

3

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.

+2  A: 

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

SET NAMES 'utf8';
Ain
+3  A: 

This part of your query:

LIKE '%Ú%'

is attempting to select results with accented characters. The utf8_general_ci collation removes accents: http://stackoverflow.com/questions/1036454/what-are-the-diffrences-between-utf8-general-ci-and-utf8-unicode-ci

SimpleCoder
A: 
SELECT direccion_principal
FROM tb_dysport_contacto_medico_terapeutica
WHERE direccion_principal LIKE '%Ú%' collate utf8_bin

But this also makes it case sensitive.

ceteras