Cast COLLATE
mysql>
mysql> CREATE TABLE LETTERS
-> (SEQNO INTEGER NOT NULL PRIMARY KEY,
-> LETTER CHAR(1) CHARACTER SET UTF8 NOT NULL)
-> ;
Query OK, 0 rows affected (0.00 sec)
mysql> -- insert data ;
mysql> SELECT LETTER, COUNT(*)
-> FROM (SELECT LETTER COLLATE latin2_czech_cs AS LETTER
-> FROM LETTERS) AS LATIN2_CZECH_LETTERS
-> GROUP BY LETTER
-> ;
ERROR 1253 (42000): COLLATION 'latin2_czech_cs' is not valid for CHARACTER SET 'utf8'
mysql> SELECT LETTER, COUNT(*)
-> FROM (SELECT LETTER COLLATE latin2_croatian_ci AS LETTER
-> FROM LETTERS) AS LATIN2_CROATIAN_LETTERS
-> GROUP BY LETTER;
ERROR 1253 (42000): COLLATION 'latin2_croatian_ci' is not valid for CHARACTER SET 'utf8'
mysql>
mysql> drop table letters;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category