n92
n92

Reputation: 7602

How to ignore collation in mysql query

I have got a field in mysql table with the type SET and collation latin general ci and i am querying like this

SELECT * FROM `tblCountry` WHERE FIND_IN_SET("KAN", `tLang`)

, It works fine in sqlyog, but in phpmyadmin it gives me error

#1267 - Illegal mix of collations (utf8_unicode_ci,COERCIBLE) and (latin1_general_ci,IMPLICIT) for operation 'find_in_set'

So how to ignore the collation type, is there any work around for this

Upvotes: 2

Views: 1514

Answers (1)

Quassnoi
Quassnoi

Reputation: 425693

SELECT  *
FROM    tblCoutnry
WHERE   FIND_IN_SET(CAST('KAN' AS CHAR CHARACTER SET latin1) COLLATE latin1_general_ci, tlang)

Upvotes: 2

Related Questions