mysql-连表查询问题

错误:

Illegal mix of collations (utf8mb4_0900_ai_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation '='

原因:

对两个具有不同字符集校对规则(collation)的列进行比较操作(这里是 = 操作),而 MySQL 不允许这样的混合操作。

解决:

在查询中显式指定校对规则。

select a.* from table_a a inner jion table_b b on a.a = b.a COLLATE utf8mb4_general_ci;
posted @ 2025-03-12 11:13  扬帆去远航  阅读(83)  评论(0)    收藏  举报