ERROR 1267 (HY000): Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_danish_ci,IMPLICIT) for operation '='
mysql>
mysql> CREATE TABLE TWOCOLL
-> (C1 CHAR(10) COLLATE 'latin1_general_ci' NOT NULL,
-> C2 VARCHAR(10) COLLATE 'latin1_danish_ci')
-> ;
ERROR 1050 (42S01): Table 'twocoll' already exists
mysql> INSERT INTO TWOCOLL VALUES ('A', 'A')
-> ;
Query OK, 1 row affected (0.00 sec)
mysql> SELECT *
-> FROM TWOCOLL
-> WHERE C1 = C2
-> ;
ERROR 1267 (HY000): Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_danish_ci,IMPLICIT) for operation '='
mysql> SELECT *
-> FROM TWOCOLL
-> WHERE C1 COLLATE latin1_danish_ci = C2
-> ;
+----+------+
| C1 | C2 |
+----+------+
| A | A |
| A | A |
+----+------+
2 rows in set (0.00 sec)
mysql> SELECT *
-> FROM TWOCOLL
-> WHERE C1 COLLATE utf8_general_ci = C2;
ERROR 1253 (42000): COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'latin1'
mysql>
mysql> drop table TWOCOLL;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category