sql报错Illegal mix of collations

Posted w329636271

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql报错Illegal mix of collations相关的知识,希望对你有一定的参考价值。

select company_name from upload_record_detail where company_name in ('晋县高贤纸箱𠂆_否_是','邢台欧乐建筑工程有限公司_否_是')

查询报错:

[HY000][1270] Illegal mix of collations (utf8_general_ci,IMPLICIT), (utf8mb4_0900_ai_ci,COERCIBLE), (utf8mb4_0900_ai_ci,COERCIBLE) for operation ' IN '

修改为:

select company_name from upload_record_detail where
    company_name in (
    <foreach collection="list" item="obj" separator=",">
      #obj COLLATE utf8mb4_0900_ai_ci
    </foreach>
    ) and del_flag = 0

以上是关于sql报错Illegal mix of collations的主要内容,如果未能解决你的问题,请参考以下文章

mysql union语句报错:Error Code: 1271. Illegal mix of collations for operation ‘UNION‘

执行mysql语句报错 Illegal mix of collations……

报错:illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation

MySQL SQL error: #1271 - Illegal mix of collations for operation 'UNION'

java.sql.SQLException: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) ....错误

java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_