JohnnyAce
JohnnyAce

Reputation: 3739

MySQL Where Query using string with special characters

I have the following query:

SELECT *
FROM (
`teams`
)
WHERE `name` = 'mi equiñerolico'

And the result of this query is:

idteam|name|datet
9|mi equiñerolíco|2012-06-23 12:15:32

As you can see it retrieves a row with the name 'mi equiñerolíco' even though that my Where clause establish that it must be 'mi equiñerolico'.

teams table has utf8_general_ci collation.

How can I solve this ambiguity?

Upvotes: 1

Views: 804

Answers (1)

Andomar
Andomar

Reputation: 238126

You could use a binary collation to force an accent-sensitve compare:

select  * 
from    teams 
where   name = 'mi equiñerolico' collate utf8_bin

Upvotes: 2

Related Questions