Cristian
Cristian

Reputation: 200080

Weird result at selecting rows

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.

Upvotes: 0

Views: 64

Answers (3)

Chris Laplante
Chris Laplante

Reputation: 29658

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?

Upvotes: 2

ceteras
ceteras

Reputation: 3378

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

But this also makes it case sensitive.

Upvotes: 0

Ain Tohvri
Ain Tohvri

Reputation: 3035

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

SET NAMES 'utf8';

Upvotes: 2

Related Questions