Mysql查询报错:Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

2023-02-17,,,,

使用sql别名关联查询的时候,由于字符集冲突导致该错误

解决方案,查询的时候强制转换字符集类型

case when column = '' then
_gbk '' collate gbk_chinese_ci
end as 别名

  

Mysql查询报错:Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='的相关教程结束。

《Mysql查询报错:Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='.doc》

下载本文的Word格式文档,以方便收藏与打印。