1.问题

今天又在mysql中遇到了,吐血。

2.解决方案

SQL最后加上

COLLATE utf8mb4_unicode_ci

SELECT t2.cust_id as cust_id_ex,t1.* from
(
SELECT * from credit_nigeria.apply WHERE updateTime>"2019-11-10"
) t1
RIGHT JOIN ( SELECT cust_id from bank_nigeria.ng_trans_record WHERE update_Time>"2019-11-18 04" and update_Time<"2019-11-18 05" and pay_type="xx"
) t2
on
t1.custid=t2.cust_id COLLATE utf8mb4_unicode_ci order by t2.cust_id, updateTime desc ;

在哪里加?

我也不太知道。。。都是试。表后面,字段后面,变量后面

 案例:

案例一

案例二:

3.原理

utf8mb4对应的排序字符集有utf8mb4_unicode_ci、utf8mb4_general_ci.

utf8mb4_unicode_ci和utf8mb4_general_ci的对比:

  • 准确性:
  1. utf8mb4_unicode_ci是基于标准的Unicode来排序和比较,能够在各种语言之间精确排序
  2. utf8mb4_general_ci没有实现Unicode排序规则,在遇到某些特殊语言或者字符集,排序结果可能不一致。

但是,在绝大多数情况下,这些特殊字符的顺序并不需要那么精确。

  • 性能
  1. utf8mb4_general_ci在比较和排序的时候更快
  2. utf8mb4_unicode_ci在特殊情况下,Unicode排序规则为了能够处理特殊字符的情况,实现了略微复杂的排序算法。

但是在绝大多数情况下发,不会发生此类复杂比较。相比选择哪一种collation,使用者更应该关心字符集与排序规则在db里需要统一。

Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '<>'的更多相关文章

  1. 【MySQL】Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and ...

    线上遇到这个问题,详细信息如下: SQL state [HY000]; error code [1267]; Illegal mix of collations (utf8mb4_general_ci ...

  2. java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '='

    查询视图时报错:java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_ ...

  3. MySQL replication illegal mix of collations

    MySQL replication case 一则 转载:http://www.vmcd.org/2013/09/mysql-replication-case-%E4%B8%80%E5%88%99/ ...

  4. b-is-in- (1267, "Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='") SELECT id FROM qqzoneshuoshuo WHERE words=

    db-is-in- (1267, "Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8_general_ci, ...

  5. Mysql Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='

    MySQL字符串比较bug: select * from table_a a left join table_b b on a.field_a = b.field_b   error: Illegal ...

  6. 数据库 BUG:Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=

    在mysql5中遇到的问题: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) f ...

  7. Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC

    在mysql5中遇到的问题: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) f ...

  8. Django的admin管理系统写入中文出错的解决方法/1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘locate’

    Django的admin管理系统写入中文出错的解决方法 解决错误: 1267  Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and ( ...

  9. 解决Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER

    今天在用java与mysql数据库时发现Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER ...

随机推荐

  1. Mac配置虚拟环境Virtualenv,安装Python科学计算包详解

    参考: https://www.jianshu.com/p/51140800e8b4 安装 virtualenvwrapper Virtaulenvwrapper是virtualenv的扩展包,可以更 ...

  2. (JavaScript) 百度地图与腾讯地图坐标转换

    /** * 坐标转换,百度地图坐标转换成腾讯地图坐标 * lng 腾讯经度(pointy) * lat 腾讯纬度(pointx) * 经度>纬度 */ function bMapToQQMap( ...

  3. java学习基础知识入门

    基础入门知识(一) 一.java技术的分类 java按照技术标准和应用场景的不同分为三类,分别是JAVASE.JAVAEE.JAVAME JAVASE : 平台标准版,用于开发部署桌面,服务器以及嵌入 ...

  4. wordpress 后台无法登录 网站内容缺失

    昨天网站又突然不正常了,前两天都是好的.. 具体来说就是wp后台登录不进去,一直在登录页跳转,与此同时服务器上其他网站也有这个问题,而且有些网站的板块内容也缺失了, 所以首要就是要登录进后台看看是不是 ...

  5. Python笔记day20-面向对象

    目录 面向对象 1 装饰器 1.1 装饰器是什么? 1.2 装饰器 2 面向对象 (Object Oriented) 简称OO 2.1 面向对象相关术语 2.2 类和对象 2.3 类和对象的实现和书写 ...

  6. (九)shiro之web集成

    Url 匹配方式? 匹配一个字符 /admin? 可以匹配/admin1 或者/admin2 但是不能匹配/admin12 或者/admin* 匹配零个或者一个或者多个字符 /admin* 可以匹配 ...

  7. Effective Java 读书笔记(二):对象通用方法

    1 重写equals方法时请遵守通用约定 (1)无需覆盖equals方法的情况 要求独一无二 不要求逻辑相等 超类已经覆盖equals方法,对其子类也适用 一个类是私有的或者是包私有(可以重写后抛出异 ...

  8. python 练习:函数1

    习题: 定义一个方法 func,该func可以引入任意多的整型参数,结果返回其中最大与最小的值. def func(**args): return max(args),min(args) 定义一个方法 ...

  9. Bminer

    Bminer https://www.bminer.me/zh/ Bminer: When Crypto-mining Made Fast¶ Bminer是一款为NVIDIA和AMD GPU深度优化的 ...

  10. Zuul + Ribbon 脱离Eureka完成负载均衡+重试机制

    Zuul + Ribbon 脱离Eureka完成负载均衡+重试机制 因为没有注册中心,所以需要网关对下游服务做负载均衡,然后果断集成Ribbon.中间遇到很多坑,最后终于解决了. 其实Ribbon里面 ...