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

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

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

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

  

猜你喜欢

转载自www.cnblogs.com/qinjf/p/10622177.html